Linux Backups For Real People, Part 3 - page 3
Simple Network Backups
An inexpensive way to perform network backups is to an external hard drive attached to one of your PCs. You'll need an SSH server running on its attached PC, and SSH clients for everyone else. Rather than giving everyone a login on the backup PC, create a special backup account for everyone to use with a clever, catchy name like "backup". Keep in mind that everyone who has access to the backup drive can easily read all the files on it.
Suppose the drive is attached to a PC named Penguina. Assuming you have local DNS like a good Linux geek, you can test logging in remotely like this:
$ ssh backup@penguina backup@penguina's password:
You may also use the IP address, if it's a static address.
We don't want to be prompted for a password because that defeats automatic scheduled backups, so instead we'll use SSH public key authentication. It's easy to set up- just follow the "Public-Key Authentication" section of The (Practically) Ultimate OpenSSH/Keychain Howto, except do not set a passphrase!
Now let's fix up our backup script to use the remote drive. Change the last line to look like this:
Notice a new addition, the "carla" directory. Since this is a shared network drive you'll probably want to give each user their own directory.
rsync will create them for you. Remember, do not have a trailing slash! (See Part 2 for more information.) The syntax is simple: login-name@hostname:/full-file-path-of-the-backup-directory.
Now what about scheduling unattended backups? Piece of cake--we'll make an entry in
/etc/crontab, which is a delightfully simple way of using
cron. This example runs the backup script every weeknight at 11:05pm:
23 5 * * 1-5 carla /home/carla/backupscript
man 5 crontab tells all of your options.
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: GNOME 3.12 and New Betas for Ubuntu 14.04 and OpenMandriva Lx 2014.0
- 2Linux Top 3: Linus Lashes out, Linux 3.14 Gets PIE and Ubuntu One is Done.
- 3Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic
- 4Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 5Linux Top 3: Debian Gives Up on Upstart, Ubuntu and Linux Kernel Updates