linux backup to external drive
Does anyone know if there is a way to backups to an external hard drive. The script I am running is on a linux box, but the external drive is on an XP machine. I want to be able to run the backup and have the tar files saved to the external hard drive.
Code I am using is as follows: #!/bin/bash #This script is to be used to backup to disk directories that #may be scattered around a network on Microsoft Shares. #Written by: Dennis Williams #Date: June 18, 2004 # #--------------Environment variables for protocaselaptop-------------------- # #this is the administrator account on the windows machines USERNAME1=administrator PASSWORD1=administrator_password # #---the place you want to do the backup to # #DRIVE=/some/path/to/directory DRIVE=//laptop/backup/backup ###This is where I try to save # # #You will need to create more of these sections, #one for each machine that you wish to do a backup of #TARGET_MACHINE and BACKUP_SHARE are the names #of the target machine and the shared directory # #TARGET_MACHINE=machine_name #BACKUP_SHARE=share_name # TARGET_MACHINE=Protocaselaptop #BACKUP_SHARE=outlook # mkdir $DRIVE/$TARGET_MACHINE cd $DRIVE/$TARGET_MACHINE # smbclient //$TARGET_MACHINE/Outlook $PASSWORD1 -U $USERNAME1 -c "recurse;prompt;mget *;" # tar cvpz $DRIVE/$TARGET_MACHINE > $DRIVE/$TARGET_MACHINE.tar.gz rm -rf $DRIVE/$TARGET_MACHINE # #You will be left with a file called protocaselaptop.tar.gz #located in the /root/backup/target_machine directory you specified in the $DRIVE variable # Cheers, dennis |
All times are GMT -5. The time now is 07:49 PM. |