Backup and Restore to network?

Suggestions for features and software you would like to see in DietPi, goes here.
Post Reply
Databeredning
Posts: 2
Joined: Sat Dec 15, 2018 3:01 pm

Backup and Restore to network?

Post by Databeredning »

I have tried the backup and restore and it works fine with a usb drive.
Would it be possible to add support for a network target?
Like running a rsync server on a Synology or similar?
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: Backup and Restore to network?

Post by MichaIng »

@Databeredning
Thanks for your request.

Since we are using rsync anyway, this is a reasonable request. I added it to GitHub: https://github.com/Fourdee/DietPi/issues/2364
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: Backup and Restore to network?

Post by baz123 »

Could not decide whether to comment here or on GitHub, decided here as it might be a different feature request.

Could the backup create a compressed archive that could be saved to an off device location (samba share, rsync, USB device, cloud file storage)?

[edit] this would then need a facility to import a compressed archive to restore from.

Could there be a schedule function for backup as well so backups are taken at a regular interval/specific time?

Is the backup effectively a shadow copy of the whole system?
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: Backup and Restore to network?

Post by MichaIng »

baz123 wrote: Tue Jan 22, 2019 11:49 am Could the backup create a compressed archive
Indeed we had a feature request about this on GitHub: https://github.com/Fourdee/DietPi/issues/816
Result as you can see, is that this is not something that will be implemented into DietPi-Backup, there are too many downsides and nearly no advantages, since the system itself usually does not take much disk space. If your really need this, I would go with a third party solution that allows incremental compressed backups, e.g.: https://github.com/borgbackup/borg
baz123 wrote: Tue Jan 22, 2019 11:49 am to an off device location (samba share, rsync, USB device, cloud file storage)?
This on the other hand is something easy to implement with plain rsync. Open request: https://github.com/Fourdee/DietPi/issues/2364
Note that you can already sync to most of the mentioned destinations, since samba/FTP/NFS mounts and USB drives can be chosen as destination. Only using the plain file transfer protocol, e.g. for SFTP/SCP or FTP without mount, via rsync is not yet possible, but as said easy to implement.
baz123 wrote: Tue Jan 22, 2019 11:49 am Could there be a schedule function for backup as well so backups are taken at a regular interval/specific time?
Another open request in the pipe: https://github.com/Fourdee/DietPi/issues/2051

So finally, besides having backups stored compressed, all this is planned. Then problem is, most likely we will implement this via a larger rewrite and merge of the two scripts dietpi-sync and dietpi-backup. dietpi-sync allows scheduled sync via cron job while dietpi-backup allows backup & restore. Besides that both do moreless the same. We aim to merge them to have a more universal sync script that allows multiple sources and destinations (including remote systems, using the native rsync feature for this), forward- and backwards sync, enable/disable automatic schedule for them, and besides, allow to keep multiple backup instances: https://github.com/Fourdee/DietPi/issues/1785

But yeah, it's a larger project between at least one other larger project about DietPi-LetsEncrypt/HTTPS.
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: Backup and Restore to network?

Post by baz123 »

Thanks for the detailed reply.

To be clear, I was not suggesting replacing the rsync backup method (which is excellent), more I wanted to be able to create a tar zipped archive that could be easily moved off device. By using tar after the backup rsync, and also utilising the update flag this could be relatively painless.

I just did exactly this from the command line and I will probably try to automate it to follow on from a dietpi-backup. It is the old 3-2-1 backup; on device - off device - off premises. I will setup a test machine and see if I can restore the tar into the backup folder and then restore the diet-pi instance from the backup tool (always test your backups).

Also, I would not favour a full rsync to a remote device - just does not suit my setup.

However, happy to accept your logic and decision :D
Post Reply