Unattended Linux Wakeup, Backup, Shutdown (part 5) - page 2
The Master Plan, Cron Wakeups
Cron ShutdownThis goes on each individual computer in the /etc/crontab file, shutting them down at 12:30 AM:
# m h dom mon dow user command
30 00 * * * root /sbin/shutdown -h +5
Scheduling BackupsEach client computer run its own backup script from cron. There are a half-dozen PCs on my little LAN, and I schedule them to start five minutes apart. Run crontab -e for each user and create an entry like this:
# m h dom mon dow command
40 23 * * * $HOME/backup_script
When you're testing cron jobs, schedule them a minimum of two minutes into the future or they won't run.
Don't Use Rsync!Every time I write about rsync backups readers write to me suggesting that the simple rsync mirroring I use is not adequate, and I should be using incremental backups for each day of the week, or versioned backups, or compressed using tar, or something else that is more complicated. Use whatever suits your needs; I keep it simple to keep these articles from growing out of control, and I think incremental backups and snapshots are oversold for user data backups. rdiff-backup and rsnapshot are good tools for incremental backups, and rsync can also make these with a bit of scripting. You can find good examples all over the place. Any of these can be tailored to suit your needs and incorporated into this splendid hands-off backup regime.
ResourcesAlways remember the excellent man pages:
My own Linux Cookbook has chapters on rsync and running a local NTP server.
SSH, The Secure Shell: The Definitive Guide (O'Reilly Media) is a great guide to learning the many things that OpenSSH can do. A must-have for all Linux admins.
Carla Schroder is the author of the Linux Cookbook and the Linux Networking Cookbook (O'Reilly Media), the upcoming Book of Audacity (NoStarch Press), a lifelong book lover, and the managing editor of Linux Planet and Linux Today.
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: RHEL 6.5, Debian 7.2 and EOL for Linux 3.0.x
- 5Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10