Re: Continue backup

Denis Corbin <[email protected]> Thu, 13 Jul 2023 16:37:58 +0200
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <[email protected]>

On 12/07/2023 23:59, Siddharth Manthan wrote:
> I am attempting to create a gui for dar backup. The gui will cater to 
> people who don't have much idea about backups, basically click backup to 
> backup the data. The backup tasks will run unattended. This means that a 
> user might shut down the pc or there might be a power cut while the 
> backup is running. Since the target computer is unknown it is also not 
> possible to separate the files based on directories. Different users 
> will have different directory structure.
> 
> How well does dar deal with stuff like this? How can I continue the 
> backup where it left off ?
> 

It depends on how you interrupt dar and the filesystem/OS:
Assuming you do a clean shutdown/halt and the filesystem is not 
corrupted, upon SIGINT received from the operating system, dar will 
cleanly close the running backup and you will be able to use it fully 
(see step 2)

If the interruption was more violent, after filesystem has been repaired 
  you can also repair the dar backup (dar's -y option) to get a fully 
usable backup as above.

Step 2: To continue the backup process, a simple way is to make a 
differential backup using this first backup (the interrupted one) as 
reference. This will be efficient as only the files not in the 
interrupted backup or that have changed since that time will be added to 
this second backup. Then and you are good with your system fully backed up.

Of course if subsequent interruptions occurs, you can recursively do 
differential backup (well better say incremental backup), using the 
latest (interrupted backup) as reference.

Restoration is then simple: restore the first (interrupted) backup, then 
restore the second one (eventually subsequent ones). You are done.

You can also merge the two backup to create a single full backup:

dar --merge new_full_backup -A interrupted_backup -@ diff_backup 
full-from-diff

(you can do that iteratively if you have more than one interruption)

Restoration is then even simpler... as you can guess.

Last you can rely on dar_manager and add either the two or more 
incremental/differential backups or instead the merged backup to a 
dar_manager database in order to restore some particular files easily.

I hope this answers your question

Cheers,
Denis
OpenPGP_signature (application/pgp-signature, 840 B) - not displayed