[NTLUG:Discuss] Bash/rsync script help.

Mittelgeek mittelgeek at gmail.com
Mon Mar 16 11:41:52 CDT 2009


Just happened to notice that you have **mnt** listed twice and I don't see
any other reference to that same path in your script. Not sure if this will
fix the problem but it might be something to double check.

rm -rf /mnt/usb/vol1/* *mnt* */*


On Mon, Mar 16, 2009 at 11:02 AM, CoryC <oakleeman at yahoo.com> wrote:
>
> I have an Openfiler NAS that I am backing up our other servers to on a
nightly basis. I'm maintaining between 10-30 days worth of backups depending
on the server. Once a week I want to be able to plug in a USB hard-drive and
use rsync to backup any files that have been modified in the past week. That
hard-drive is then taken offsite.
>
> For the most part I have this working except deleting files on the USB
hard-drive that aren't part of the original list. I have to manually delete
the files currently on the drive before I start or else I run out of
hard-drive space. Could someone take a look at my process to see what might
be wrong?
>
> Thanks,
>
> Cory
>
> #mount the usb hard drive
> mount -t auto /dev/sde1 /mnt/usb/vol1/
>
> #delete the files on the usb hard drive
> #temp fix for rsync --delete not working
> rm -rf /mnt/usb/vol1/mnt/*
>
> #create a list of the files modified in the last week
> find /mnt/raid5/vol1/server_backups -ctime -7 -type f -print >
/backup/modified_files.txt
>
> #rync the files
> rsync -avR --delete --files-from=/backup/modified_files.txt /
/mnt/usb/vol1/
>
> #unmount the usb hard drive
> umount /mnt/usb/vol1/
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>


More information about the Discuss mailing list