Add a configuration backup SPK
To backup SPKs configuration files and restore them.
- All available SPKs are in /usr/local/* filtered with a hardcoded list of SPKs we support for this feature
- Send a zip to the user with the /var directory and without the pid file
- Ability to restore from such a zip + chown the /var directory with the same owner:group as its parent directory
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Would definately look forward to this, the more apps I have, the more configurations could I potentially loose in case of theft and the like.
To select the backup-able spk, I propose to use a dedicated key in the INFO file. Some thing like backup_restore_cmd='path to command' This command could take a few standardized parameters to do the job, like -b for backup and -r for restore, followed by a target/source file name.
BTW, using custom keys in the INFO file is documented by Synology, and seems quite clean to me.
And the "backup SPK" would loop over packages in /var/packages, parse the INFO in there and look for the command to execute?
I was thinking of a more standard way as we put all user data in /usr/local/package/var directory, just zip it and send it to the user through the DSM interface.
Your solution would be more flexible but for now, the var directory is enough.
Oh and I ran into an interesting feature: DSM > Backup and restore > fake a local backup When it's time to select the source you can check one of "Application" in which you have "Photo" that is now a full SPK by Synology. I wonder if it is possible to add our SPKs in there. That would truly be awesome and a much better integration. That's something I have to ask to Synology
Are there any news on this front? Being able to select an application under Backup and restore would be great!
Ask Synology.
Fwiw, it's technically possible. Here's a starting point: http://www.synology-forum.de/showthread.html?68578-HowTo-3rdparty-Apps-in-DSM-Sicherung-Replication-integrieren. Synology currently hasn't included it in their developers guide though, and someone will have to find to time to integrate it into spksrc.
@Dr-Bean so if i get this right... we just need to support copying a folder (backup) to the scripts folder when building the SPK and maybe automatically generate the version file?
Indeed, although I was thinking that the files could be completely auto-generated via spksrc, probably similar to how the INFO file is created. I'd prefer that over a manual approach for each package, because that just looks like a bunch of mindless copy/pasting once you've figured out what goes where.
As an example (and yes, I realize it's more advanced than a straight-forward package with just files): if a database is included in the package, let spksrc add the handler and fill the dbname in the info file, and set the offline mode to ensure the package is stopped before starting the backup.
Note that I haven't spent a lot of time on it, but from what I can see, it looks feasible to automate it for a large majority of the packages.