Changes

From SME Server
Jump to navigationJump to search
1,022 bytes added ,  23:19, 15 March 2020
no edit summary
Line 4: Line 4:     
[http://dar.linux.free.fr/ DAR homepage]
 
[http://dar.linux.free.fr/ DAR homepage]
 +
 +
{{Note box|'''Important''' - Be aware of the concepts and issues as described in this section https://wiki.contribs.org/Backup_server_config#Backup_and_Restore_concepts.2C_issues_and_other_information}}
    
===Typical scenarios===
 
===Typical scenarios===
Line 39: Line 41:       −
====More commom scenarios & explanation of backup selection settings====
+
====More common scenarios & explanation of backup selection settings====
    
Here are some typical scenarios, keep in mind the choice of full backup on a specified day or every day will also interact with these settings.
 
Here are some typical scenarios, keep in mind the choice of full backup on a specified day or every day will also interact with these settings.
 +
    
If you wanted to do a full backup every day, & only retain 1 historical backup, then select
 
If you wanted to do a full backup every day, & only retain 1 historical backup, then select
 +
 
Number of daily backups contained in each set is 1.
 
Number of daily backups contained in each set is 1.
 +
 
Number of rotating backup sets is 1.
 
Number of rotating backup sets is 1.
 +
    
If you wanted to do a full backup once every 7 days, then daily incremental backups every other day, & only retain 1 historical backup, select
 
If you wanted to do a full backup once every 7 days, then daily incremental backups every other day, & only retain 1 historical backup, select
 +
 
Number of daily backups contained in each set is 7.
 
Number of daily backups contained in each set is 7.
 +
 
Number of rotating backup sets is 1.
 
Number of rotating backup sets is 1.
 +
    
If you wanted to do a full backup once every 14 days, then daily incremental backups every other day, & only retain 1 historical backup, select
 
If you wanted to do a full backup once every 14 days, then daily incremental backups every other day, & only retain 1 historical backup, select
 +
 
Number of daily backups contained in each set is 14.
 
Number of daily backups contained in each set is 14.
 +
 
Number of rotating backup sets is 1.
 
Number of rotating backup sets is 1.
 +
    
If you wanted to do a full backup once every 28 days, then daily incremental backups every other day, & only retain 1 historical backup, select
 
If you wanted to do a full backup once every 28 days, then daily incremental backups every other day, & only retain 1 historical backup, select
 +
 
Number of daily backups contained in each set is 28.
 
Number of daily backups contained in each set is 28.
 +
 
Number of rotating backup sets is 1.
 
Number of rotating backup sets is 1.
 +
    
For any of the above, if you want to retain more historical backup sets, then change the
 
For any of the above, if you want to retain more historical backup sets, then change the
 +
 
Number of rotating backup sets to 2 or 3 or 4 as desired
 
Number of rotating backup sets to 2 or 3 or 4 as desired
       
So let's say the full backup is set to run on Friday only, & the backup time is set for 11pm.
 
So let's say the full backup is set to run on Friday only, & the backup time is set for 11pm.
 +
 
On the first Friday night at 11pm a full backup is done, this may take many hours or even time out if there is a lot of data to backup.
 
On the first Friday night at 11pm a full backup is done, this may take many hours or even time out if there is a lot of data to backup.
    
On the first Saturday night at 11pm if the full backup did not complete the night before (timed out as per time out setting or reached 24 hours run time), then the full backup is continued on from where it left off.
 
On the first Saturday night at 11pm if the full backup did not complete the night before (timed out as per time out setting or reached 24 hours run time), then the full backup is continued on from where it left off.
 +
 
If the full backup did complete, then an incremental backup is done, so only the additions & changes of data are added to the first full backup.
 
If the full backup did complete, then an incremental backup is done, so only the additions & changes of data are added to the first full backup.
 +
 
These are added as incremental backups, in a seperate incremental backup file with a date identifier.
 
These are added as incremental backups, in a seperate incremental backup file with a date identifier.
   Line 73: Line 92:     
Then on the Friday (being either day 8, 15 or 29 in examples above) at 11pm a new full backup is done.
 
Then on the Friday (being either day 8, 15 or 29 in examples above) at 11pm a new full backup is done.
 +
 
After that incremental backups are done each day, & so the cycle continues on.
 
After that incremental backups are done each day, & so the cycle continues on.
 +
    
Note, when a full backup is done:
 
Note, when a full backup is done:
 +
 
If Number of rotating backup sets is set to 1, then the original (first) backup is deleted.
 
If Number of rotating backup sets is set to 1, then the original (first) backup is deleted.
 +
 
If Number of rotating backup sets is set to 2, then the original (first) backup set is retained & a new backup set is created/started.
 
If Number of rotating backup sets is set to 2, then the original (first) backup set is retained & a new backup set is created/started.
 +
 
If Number of rotating backup sets is set to 3, then the first & second backup sets are retained & a new backup set is created/started.
 
If Number of rotating backup sets is set to 3, then the first & second backup sets are retained & a new backup set is created/started.
 +
 
If Number of rotating backup sets is set to 4, then the first, second & third backup sets are retained & a new backup set is created/started.
 
If Number of rotating backup sets is set to 4, then the first, second & third backup sets are retained & a new backup set is created/started.
 +
 
.... & so on.
 
.... & so on.
   Line 86: Line 112:     
A "practical" backup approach may be to configure for a Full backup every 7 days & daily incremental backups in between, with 2 rotating sets, so a new full backup is created each Friday & you retain a complete 7 days worth of backups for historical purposes.
 
A "practical" backup approach may be to configure for a Full backup every 7 days & daily incremental backups in between, with 2 rotating sets, so a new full backup is created each Friday & you retain a complete 7 days worth of backups for historical purposes.
 +
 
You could even extend that to retaining 4 sets of historical backups, in case you wanted to restore some individual files from 25 days ago.
 
You could even extend that to retaining 4 sets of historical backups, in case you wanted to restore some individual files from 25 days ago.
   Line 102: Line 129:  
each set".
 
each set".
   −
if you want a fixed number of increments in each set, then choose "Full backup
+
If you want a fixed number of increments, less than a multiple of 7, in each set, then choose "Full backup
is allowed on" = Anyday.
+
is allowed on" = Everyday. eg Daily backups in each set = 6 will result in 1 Full backup and 5 incremental backups, on each full backup all backups are deleted including the incrementals.
 +
 
    +
The above descriptions can relate to unusual combination of settings, where the number of incrementals does not match or equate to the full backup period.
 +
It is probably simpler to use (& to understand) setting values that are relative to each other eg weekly (7 day) full backup with 7 incrementals.
    
===Backup timeouts explained===
 
===Backup timeouts explained===
Line 160: Line 190:     
Create the deletion script
 
Create the deletion script
  pico -w /opt/scripts/deletebkp1
+
  nano -w /opt/scripts/deletebkp1
    
Enter the following (using your share name, user, pasword & domain)
 
Enter the following (using your share name, user, pasword & domain)
Line 174: Line 204:     
Create the cron job
 
Create the cron job
  pico -w /etc/cron.d/deletebkp1
+
  nano -w /etc/cron.d/deletebkp1
    
Enter the following (setting the time & day to be just before your scheduled backup time), see below.
 
Enter the following (setting the time & day to be just before your scheduled backup time), see below.
Line 200: Line 230:  
The slice size can be changed for example to suit 4.7Gb DVD's, by making 3 parts fit on to a DVD, so the required slice size is 1529Mb (allowing for overheads & real data size).
 
The slice size can be changed for example to suit 4.7Gb DVD's, by making 3 parts fit on to a DVD, so the required slice size is 1529Mb (allowing for overheads & real data size).
   −
Create the custom template fragment
+
Set the Slice size in the config DB
mkdir -p /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf
+
  config setprop backupwk Slice 1529M
cp /etc/e-smith/templates/etc/dar/DailyBackup.dcf/90slice /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf
  −
 
  −
(the above cp command is all on one line)
  −
 
  −
Modify the file size & save
  −
  nano -w /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf/90slice
  −
 
  −
Edit it to read like this
  −
{
  −
($backupwk{Slice} || '1529M') eq '1529M' ?  "--slice 1529M\n" : "--slice $backup"
  −
}
  −
 
  −
Then save & exit
  −
Ctrl o
  −
Ctrl x
      
Then expand the template with
 
Then expand the template with
 
  expand-template /etc/dar/DailyBackup.dcf
 
  expand-template /etc/dar/DailyBackup.dcf
      
The next time the backup runs, the resultant backup file will be split into 1.529Gb part sizes.
 
The next time the backup runs, the resultant backup file will be split into 1.529Gb part sizes.
Line 235: Line 249:  
  mkdir -p /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf
 
  mkdir -p /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf
 
   
 
   
  pico -w /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf/41go-into
+
  nano -w /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf/41go-into
 
   
 
   
 
  --go-into opt
 
  --go-into opt
Line 259: Line 273:  
Create custom template fragment to exclude the unneeded files and directories
 
Create custom template fragment to exclude the unneeded files and directories
 
   mkdir -p /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf
 
   mkdir -p /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf
   pico -w /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf/45prune
+
   nano -w /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf/45prune
 
    
 
    
 
   --prune home/e-smith/files/ibays/mirror/cgi-bin
 
   --prune home/e-smith/files/ibays/mirror/cgi-bin
Line 314: Line 328:  
=== Backup file slices are NOT autonomous ===
 
=== Backup file slices are NOT autonomous ===
 
The catalogue of the contents of the backup is put in the last slice. If for some reason the last slice can not be written (e.g. backup medium is full or network failure), is lost or corrupt, the slices already saved are useless.
 
The catalogue of the contents of the backup is put in the last slice. If for some reason the last slice can not be written (e.g. backup medium is full or network failure), is lost or corrupt, the slices already saved are useless.
  −
=== NFS ===
  −
  −
27/06/2012 - With the current version of SME Version 8 and 9 it would appear that NFS is not installed by default.
  −
  −
To enable backup via nfs you will need to install nfs-utils from base :
  −
  −
yum install nfs-utils
  −
  −
For further information please see this bug http://bugs.contribs.org/show_bug.cgi?id=7006
      
=== Naming of the backups on the workstation share or USB disk ===
 
=== Naming of the backups on the workstation share or USB disk ===
Line 380: Line 384:  
First, MOUNT THE BACKUP DRIVE (if required):
 
First, MOUNT THE BACKUP DRIVE (if required):
 
  mount /dev/sdc1 /media/BackupDrive1/
 
  mount /dev/sdc1 /media/BackupDrive1/
 +
 +
You can mount the configured CIFS/SMB destination using<syntaxhighlight lang="bash" >
 +
mount -t cifs //$(config getprop backupwk SmbHost)/$(config getprop backupwk SmbShare) $(config getprop backupwk Mount) -o credentials=/etc/dar/CIFScredentials
 +
</syntaxhighlight>List available backups<syntaxhighlight  lang="bash" >
 +
find $(config getprop backupwk Mount)/$(config get SystemName).$(config get DomainName) -name "*.1.dar" | sed s/\.1\.dar$//
 +
</syntaxhighlight>
    
Then, RESTORE THE DIRECTORY:
 
Then, RESTORE THE DIRECTORY:
  dar -x /media/BackupDrive1/server.domain.local/set2/full-201408092200 -N -R / -w -g home/e-smith/files/ibays/share_data/files
+
  dar -x /media/BackupDrive1/server.domain.local/set2/full-201408092200 -N -R ./ -w -g home/e-smith/files/ibays/share_data/files
 +
 
 +
This will restore the directory /home/e-smith/files/ibays/share_data/files to you current directory. If your current directory is /tmp/, the files will be recovered to /tmp/home/e-smith/files/ibays/share_data/files. This will make you able to search through the recovered files and, if needed, move them to their proper location.
 +
 
 +
{{Warning box|Be sure to use -R ./ (the dot) to restore in the current dir, otherwise you'll restore files/dirs in their original path}}
    
You may also have to RESTORE ANY INCREMENTS:
 
You may also have to RESTORE ANY INCREMENTS:
  dar -x /media/BackupDrive1/server.domain.local/set2/inc-001-201408102200.1.dar -N -R / -w -g home/e-smith/files/ibays/share_data/files
+
  dar -x /media/BackupDrive1/server.domain.local/set2/inc-001-201408102200.1.dar -N -R ./ -w -g home/e-smith/files/ibays/share_data/files
  dar -x /media/BackupDrive1/server.domain.local/set2/inc-002-201408112200.1.dar -N -R / -w -g home/e-smith/files/ibays/share_data/files
+
  dar -x /media/BackupDrive1/server.domain.local/set2/inc-002-201408112200.1.dar -N -R ./ -w -g home/e-smith/files/ibays/share_data/files
  dar -x /media/BackupDrive1/server.domain.local/set2/inc-003-201408122200.1.dar -N -R / -w -g home/e-smith/files/ibays/share_data/files
+
  dar -x /media/BackupDrive1/server.domain.local/set2/inc-003-201408122200.1.dar -N -R ./ -w -g home/e-smith/files/ibays/share_data/files
  dar -x /media/BackupDrive1/server.domain.local/set2/inc-004-201408132200.1.dar -N -R / -w -g home/e-smith/files/ibays/share_data/files
+
  dar -x /media/BackupDrive1/server.domain.local/set2/inc-004-201408132200.1.dar -N -R ./ -w -g home/e-smith/files/ibays/share_data/files
    +
{{Note box|Unmount the backup destination after any manual exploration:
 +
  umount $(config getprop backupwk Mount)}}
 +
----
   −
----
  −
[[Category:Contrib]]
   
[[Category: Backup]]
 
[[Category: Backup]]
 +
[[Category:Howto]]
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,233

edits

Navigation menu