
Phil’s Diary - [Blog @ http://www.philsdiary.net/]
The following is the script I used to setup Linux to backup a Windows 2000 shared directory:
cd backup
rm backup1.tar.gz
mv backup.tar.gz backup1.tar.gz
smbclient //w2kmachinename/sharename -Uusername%password -N -Tc backup.tar
gzip -9 backup.tar
ls -al > message.txt
cat message.txt | smbclient -M w2kmachinename/sharename
rm -f message.txt
The first line moves into the backup folder. This could be an absolute reference /home/backup for example, or relative as this is.
The next line removes the backup from two days ago.
Then we replace that with yesterdays backup.
smbclient.… copys the contents of the share specified to a file called backup.tar
Then we gzip it, maximum compression
I then do a directory dump, and send that as a winpopup message, this confirms that the backup has taken place, and a check to make sure it went ok (files size and date).
Copy this to a text file, and chmod it to be executeable. Finally add an entry in Crontab, details in a later entry.
Posted by Phil on July 27, 2001 06:24 PM | Categories: Linux