[plug] Monitoring dd

Jeff Williams jw at globaldial.com
Sat Sep 7 09:53:29 WST 2002


>
>
>Does rsync create the directories it is copying or do I have to do that
>initially?
>
>I am using a script I took from a Rsync website.
>
>#!/bin/sh
>
>    export PATH=/usr/local/bin:/usr/bin:/bin
>
>    LIST="usr var home"
>
>    for d in $LIST; do
>	mount /backups/$d
>	rsync -ax --exclude fstab --delete /$d/ /backups/$d/
>	umount /backups/$d
>    done
>
>I created a 40Gb partition on my 'backup' disk and mounted it as 'mount -t
>ext3 /dev/hdd1 /backups'
>I ran the script above and it complained about directories not being
>mounted, however the data appears in my /backups directory.
>Do I need to create /backups/usr /backups/var and /backups/home mount points
>before running rsync ?
>
>  
>
It's not rsync but the mount command there that needs the directory, 
since its trying to mount /backups/var, /backups/usr.... It would also 
need entries for /backup/* in /etc/fstab. ('man mount' if you're unsure 
about what i just said). What you probably want is:

#!/bin/sh
export PATH=/usr/local/bin:/usr/bin:/bin

LIST="usr var home"

# this is if /backups is in /etc/fstab, otherwise use full mount line:
# mount -t ext3 /dev/hdd1 /backups
mount /backups/

for d in $LIST; do
	rsync -ax --exclude fstab --delete /$d/ /backups/$d/
done

umount /backups/


Jeff

-- 
There are 10 kinds of people in the world, those that can do binary
arithmetic and those that can't.





More information about the plug mailing list