View previous topic :: View next topic |
Author |
Message |
albright Advocate
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Sat Jul 15, 2017 11:58 am Post subject: backup advice needed |
|
|
Hi all - I see that snapback2 is slated for removal
(incompatible with new perl apparently).
snapback2 worked very well as a rolling backup
up which uses hard links and rsync for a simple
and efficient backup system (daily for a week,
weekly for a month and monthly for a year).
My question is just what is a good/simple replacement
for snapback2? _________________ .... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme) |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3136
|
Posted: Sat Jul 15, 2017 1:18 pm Post subject: |
|
|
Perhaps rsync itself would be a good enough?
I have a daily cron job running a simplistic script built around this:
Code: |
DEST="/mnt/bkp"
NOW="$(date +'%Y%m%d-%H%M')"
LOG="/var/log/backup.log"
REF="--link-dest=${DEST}/${REF// /,}"
( rsync -a "${REF}/" / "${DEST}/${NOW}/" --exclude '/usr/src/' --exclude '/usr/portage' --exclude='/mnt/*' --exclude '/tmp/*' --exclude='/proc/*' --exclude='/sys/*' --exclude='/run/*' --exclude='/home/*/.cache' --exclude='/home/*/.gvfs' 2>&1 ; ) > "${LOG}" && echo local filesystem backup succeeded || echo local filesystem backup failed. Reffer to "${LOG}" for details
echo reading log file: "${LOG}"
cat "$LOG"
|
Unfortunately you can't use find to remove backups "older than" (because -a preserves time), but since directories are named with timestamps, this is a minor issue.
Of course there are a few improvements possible, like backing up each mountpoint separately by running multiple instances of rsync -x, but then you'd have to add some metadata making it more complex, and I'm not that much into making minor improvements to something I'm going to completely redesign (because my needs evolve)
Things not included here are:
Making "incremental" or "full" backup and logic that picks the mode. Unset REF to demand full backup (without hardlinking)
Finding previous backup (needed for setting REF) and deleting old backups. I've done it the "ugly" way, sorting backups by names. Works well enough in my case, but could potentially become unreliable in case of heavier duty scenarios, so I'd rather not shame myself by posting it here. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Jul 15, 2017 2:47 pm Post subject: |
|
|
Still works with stable perl 5.24, the bug reports reference 5.26
I just installed it after moving the package to my local ebuild.
But I understand your concern for the future.
Personally, I would prefer an application that used bash or python, not perl. Perl is a continual problem on Gentoo. |
|
Back to top |
|
|
skunk l33t
Joined: 28 May 2003 Posts: 646 Location: granada, spain
|
Posted: Sun Jul 16, 2017 12:50 pm Post subject: |
|
|
personally i find app-backup/borgbackup awesome... |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Sun Jul 16, 2017 2:27 pm Post subject: |
|
|
i do btrfs:snapshots:send/receive |
|
Back to top |
|
|
|