Rotate your logs!!
Files in the folder /var/log/ are enormous and fill up my hard drive! What the heck?!
Well: Rotate your log files!
Incremental backup on external hard disk: rsync and hard links
A few weeks ago, I wanted to install some form of incremental backup of my home directory on an external hard-drive. I wanted to have something like
- backup every morning at 5AM and keep it for a week
- backup every sunday at 5AM and keep it for four weeks
- backup every first day of the month at 5AM and keep it for one year
I could have set up a cron job to do that with a plain
cp command but the space need would have been huge!
I posted a message on the net and got a great answer: use rsync and hard links... I knew about rsync but did not even know what a hard link was at that point. However, this web page was of great help http://www.mikerubel.org/computers/rsync_snapshots/.
It explains everything:
cron for automated runs,
rsync for synchronisation,
- hard links (
cp -al) for saving space,
- and
mount/unmount commands to perform the backup on read-only partitions.
Even better, you can also download ready-made scripts that do everything for you with little modification...
Thanks a lot Mike Rubel!