Greetings,

I've been using rsync to backup from my various desktops and laptops to an in-house networked server. A variant of the script is appended below. Located in /etc/cron.hourly, the script pings a machine to see if it is live; if so, it proceeds to do an incremental backup to a machine-specific location on a dedicated drive. Components of this script were suggested, and then I adapted it for my situation.

Where I seem to run into some trouble is when I try to restore from the dedicated drive when it is attached to a machine via USB cable. Specifically, when running a command such as this:
rsync -av /var/backup/machine1/home/SomeUser /home

I get a lot of messages such as this:
rsync: [receiver] mkstemp "/path/to/some/file.0atuCZ" failed: Invalid argument (22)


In the process, not all files are restored.

Any guidance would be greatly appreciated.

Thank you,

MP
[email protected]

#### Begin Rsync Script ######
#!/bin/sh

HOSTS="machine1 machine2"
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY="/root/.ssh/rsync-key"
RUSER=root
RPATH=/home

for RHOST in $HOSTS
do
        ping -q -c 1 -w 5 $RHOST > /dev/null
        if [ $? -eq 0 ]; then
                echo "$RHOST is pingable"
                LPATH="/var/backup2/$RHOST"

echo "$RUSER $RHOST $RPATH $LPATH"
                $RSYNC -avz --delete -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH 
$LPATH
#               $RSYNC -avz -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH $LPATH

        sleep 5

        fi
done
exit
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to