Re: Backups; the dumbest question in the world

From: Ben O'Brien (ftoomch_at_hotmail.com)
Date: 09/28/04


Date: Tue, 28 Sep 2004 17:40:18 +1000

Adam Taube wrote:
>>nsswitch, I've been forced into having to remember to 'manually' copy my
>>backups weekly to one of the Sun boxes that get tape-backedup.
>>
>>Does anyone have any kind of solution to this?
>
>
> Use ssh tunneled rsync to back up from one machine to the other. You can
> generate keys using openssl so that your backup script can either copy the
> tar.gz directly to the other machine automatically without having to enter
> password - on the backup machine create a user called 'rsync' or whatever
> you decide, create the key on the source machine and put it in the
> authorized_keys file in ~rsync/.ssh/ - then have cron call a script that
> will do this:
>
> /usr/local/bin/rsync -e "ssh" -acqz /backupdir/backupfile.tar.gz
> rsync@host:/home/rsync/backupdir
>
> Great thing is you can have it synchronize sets as often as you like. Even
> have multiple versions in folders for each day of the week, however you want
> to do it :-)
>
> This assumes that rsync, openssl, are installed and sshd is running on your
> machines. You don't need to run the rsync server at all for this, sshd will
> call it.
>
> For more info, man rsync
>
> :-)
>
> Adam
>
>
Indeed, this is good.

I use a variant of this to back up my stuff. Rsync is fantastic for incremental backups, far better than the old tar and
dump utilities when using hard links. Take a look at http://www.mikerubel.org/computers/rsync_snapshots/ for a pretty
good guide to rsync incremental backups.

I think if one wants to use a cron job to do this backup using ssh as the rsync transport, then ssh-agent is a must.
This means you do not have to enter ssh private key passwords every time you want to do the backup (necessary for any
cron job). It keeps your unencrypted private key in memory until you switch the computer off. A great utility for
getting ssh-agent working properly is the keychain sh script by Daniel Robbins of Gentoo Linux fame. Even though it's
written for Linux, it's just a sh script and really should work on any system with sh I think. Here's the link
http://www.gentoo.org/proj/en/keychain/index.xml

If only there was an equivalent of ssh-agent and keychain for my gpg keys!

Ben.



Relevant Pages

  • RE: croning rsync over ssh
    ... 'cron-able' ssh key (otherwise an interactive typing of the passphrase is ... to the machine that you want to backup from. ... backup machine inserted into the authorized_hosts file on the backup client ... to rsync the files. ...
    (SSH)
  • Re: Sorta OT - Backup solutions Mac to FreeBSD
    ... I am backing up 5 servers on one centralized machines using "rsnapshot" It is doing a perfect job, ... As It uses a symlink strategy, It does not use very much space on the backup device. ... and remote machines over ssh. ... If you are syncing OSX 10.4 use the Apple provided rsync and not any other. ...
    (freebsd-questions)
  • Re: Remote backup hosting setup?
    ... >> To just backup the data to a remote server is very easy, ... It comes together with rsync and ssh. ... copy changes within files over to the remote site. ...
    (freebsd-questions)
  • Re: Detecting ssh waiting terminal input
    ... > rsync has MASSES of options and can keep you occupied for many moons ... > I'd suggest you get used the basic rsync and ssh stuff then start ... > people you don't trust can use to backup and restore their stuff using ... > passwordless keys that don't allow them any other access than backup ...
    (uk.comp.os.linux)
  • Re: "write only" fs/files ?
    ... rsync over ssh to a unique userID per server is one ... There is rsync for windows too. ... - on the backup server place an authorized_keys file into the users' home: ... protected keys, and/or you can authenticate with rsync too... ...
    (FreeBSD-Security)