From: <cba...@us...> - 2003-06-04 07:04:57
|
> So, my next idea is to use the commandline. Can someone show me an > example or point me to docs that explain how I can tell BackupPC to do a > tar or zip export from the commandline? As the BackupPC user: su backuppc /usr/local/BackupPC/bin/BackupPC_tarCreate -h host -n dumpNum -s shareName files/directories... For example, for host navajo, dump number 21, shareName /home, I can get a tar archive of /home/craig with: /usr/local/BackupPC/bin/BackupPC_tarCreate -h navajo -n 21 -s /home craig There is also the -r and -p options to edit the starting part of the path (ie: if you want the tar file to have different paths than the original). There is probably a clever approach that avoids manual commands if you are prepared to write a few lines of script (in perl/ksh/tcsh/anything). Create a new host (eg: cdbackup) and do the following things in its config.pl: - set $Conf{FullPeriod} to -2 to prevent any backups of this host. - set $Conf{XferMethod} to "tar". - set $Conf{ClientNameAlias} to the local host name. - set $Conf{TarClientRestoreCmd} to something like (you will have to experiment): $Conf{TarClientRestoreCmd} = '/usr/local/BackupPC/bin/cdBackupReceive'; You can send things to cdbackup by simply restoring to the host called "cdbackup". This will create a tar file and send it to $Conf{TarClientRestoreCmd}. You should write a short script /usr/local/BackupPC/bin/cdBackupReceive that takes stdin and copies it to an output file (eg: runs 'cat > outputFile'). In fact, you could probably just do this (you can use arrays for commands to explicitly delimit arguments): $Conf{TarClientRestoreCmd} = ['/bin/tcsh', '-c', '/bin/cat > /somewhere/outputFile.tar']; If your cd writer is on a different machine you will need to change $Conf{ClientNameAlias} to point to the remote machine, and set: $Conf{TarClientRestoreCmd} = 'sshPath -q -l root $host /usr/local/BackupPC/bin/cdBackupReceive'; The one problem with this is that $Conf{TarClientRestoreCmd} doesn't know the original host, share and backup number. A solution to this is you can use $Conf{RestorePostUserCmd} (or the Pre cmd), since it allows numerous variable substitutions: $Conf{RestorePostUserCmd} = '/usr/local/BackupPC/bin/cdBackupRun $bkupSrcHost $bkupSrcShare $bkupSrcNum'; This command is run after the "restore" (ie: cat to output file) finishes. This command calls a second script with the original backup host name, original backup share name and original backup source number as arguments. This script can then take the output file from above and run the cd copy software. Hope this makes sense. Tell us if this actually works, in which case I'll put it in the FAQ. Craig |