Hi Craig,
I have been playing around with restoring backups from the command
line.

Unfortunately, the supplied CLI command BackupPC_restore does not have
much flexibility, so I have been using "raw" shell calls to rsync_bpc
to allow me to set various restore parameters.

For example, hairy lines like:

(NUM=27; RESTORE=/mnt/temp2; SHARE=/; HOST=myhost; TOPDIR=/var/lib/backuppc; 
DRYRUN=; FILESFROM=; MERGE="${NUM}/3/4"; LOG=1; sudo 
${RSYNCBPC:-/usr/bin/rsync_bpc} --bpc-top-dir $TOPDIR --bpc-host-name $HOST 
--bpc-share-name $SHARE --bpc-bkup-num $NUM --bpc-bkup-comp 3 --bpc-bkup-merge 
$MERGE --bpc-attrib-new --bpc-log-level $LOG -e /usr/bin/sudo\ -h 
--rsync-path=/usr/bin/rsync --recursive --super --protect-args --numeric-ids 
--perms --owner --group -D --times --links --hard-links --delete --partial 
${DRYRUN:+--dry-run} --log-format=log:\ %o\ %i\ %B\ %8U,%8G\ %9l\ %f%L --sta\
ts --acls --xattrs ${FILESFROM:+--files-from=$FILESFROM} / 
localhost:${RESTORE%/} >| /tmp/log.restore 2>&1)

It would be great if BackupPC_restore could allow other optional command line 
input parameters like:
- Backup number
  (since you may want to restore from something other than the latest backup)

- Alternative host/hostIP and/or root location for the restore
  (since you often may want to restore to either another host or to another 
part of your directory tree
   I find this useful to test a restore rather than risking clobbering your 
existing tree)

- Ability to restore multiple files/directories (either from the command line 
or potentially from a file)

- Ability to restore an entire host or an entire share

- Ability to override TopDir
  (useful if you are restoring from an old copy of your backuppc backups)

- Ability to do a 'dry-run' to see what will be restored before you do it
  (again to be sure you are not mistakenly restoring or clobbering files)

Note that my crude command line above allows me to do some of these 
substitutions by hacking directly
into the rsync command generated by BackupPC_retore -- but it is brittle and 
very non-elegant :)


_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to