Unix and Mac OSX Scheduled Backups

Your rsync.net filesystem is accessible over either of the ftp or ssh protocols. This means that rsync, a common Unix tool that even comes standard in Mac OSX, is a perfect choice for periodic backups scheduled in cron.

Further, because rsync.net allows users to upload their own ssh keys, it is possible to perform these backups, over ssh, in an automated fashion.

Finally, it is possible to create a script for ftp that will automatically log in and transfer files whenever it is run.

The document will assume that a username of "1004" is being used, with a password of "p455w0rd", and using the rsync.net server usw-s017.rsync.net.

rsync Scheduled in cron

As (essentially) every Unix and Mac OSX system has cron installed, a robust, automated and efficient means of periodically backing up can be obtained by simply running rsync out of cron.

rsync comes installed on many flavors of Unix, and is part of the standard Mac OSX installation. If you need source to install it, it can be found here:

http://www.samba.org/rsync/

FreeBSD users can install rsync from the ports tree by:

# cd /usr/ports/net/rsync
# make install

There is also an excellent Mac OSX tutorial on rsync here.

Once rsync is installed on your system, a line like this added to your crontab:

0 0 * * sun rsync -avz -e ssh /some/directory/tree 1004@usw-s017.rsync.net:/1004/backups

will perform automated backups for you every Sunday night at midnight.

Remember, it is possible to generate an ssh key and upload it to the .ssh directory in your rsync.net filesystem, allowing you to perform passwordless logins to support automated backups such as this.

FTP and sftp

As would be expected, you can use ftp in scripts such as this to perform automated gets and puts:

#!/bin/sh
ftp usw-s017@rsync.net <<EOF
user 1004 pp455w0rd
put /some/file /this/dir
quit
EOF

Remember that when using sftp in such a script, the -b switch must be used, details of which can be found here

sftp is also supported over ssh, allowing ftp-like interaction over a secure network link.

rsync.net - info@rsync.net