Last edited by KrunchTime (2015-03-31 03:52:07)
Place holder for change history.
This looks like a good candidate for an rsync script. Would be simple enough to sync all of my configs over to my Crunchbang Waldorf box.
Maybe...I never thought of that, although I haven't made the time to learn scripting yet.
# rsync -aAXv $SOURCE $DESTINATION
31 Mar 15 | 11:17:51 ~ $ s11bk Syncing /home to /media/disk/S11-Mar/ Syncing /media/5/ to /media/disk/M5/ 1. Syncing Complete 2. Unmount /media/disk? (Y|n) /media/disk Unmounted - Unplug now. 31 Mar 15 | 11:20:23 ~ $
Last edited by Sector11 (2015-03-31 14:29:36)
Yeah I should have noted, I have some bash wrappers setup already to backup media. It would be simple enough to fix them up to backup configs. When I get the time, I will possibly post them here. Do note, they are merely wrapper to help my mind with the complexity of an rsync command.
^ Automated backups are good for servers and desktops for those who can't seem to understand the importance of making a backup of a changed file.
The nice thing about rsync is that it can do file diffs to see what needs to be backed up. Then, if I want automation, I just schedule it as a cron job. If not, then I have a couple of simple wrapper scripts in ~/bin that are a tad more mnemonic and memory friendly to run manual backups. I backup music automatically, but need finer grained control over my movies, as I keep my kid's movies separated from mine. That way they are not accidentally subjected to zombie apocalypses, etc.
Backing up configs automatically makes a ton of sense to me, especially regarding how hard it is for me to track all the changes I make for each Live Build I do.
Thank you for the additional info, damo.
^ Another thank you.
#!/bin/bash #rsync configs over ssh to backup rsync -aAxv ~/.config/compton email@example.com:~/backup/wtfbox/configs rsync -aAxv ~/.config/openbox firstname.lastname@example.org:~/backup/wtfbox/configs rsync -aAxv ~/.config/tint2 email@example.com:~/backup/wtfbox/configs rsync -aAxv ~/.conkyrc firstname.lastname@example.org:~/backup/wtfbox/configs rsync -aAxv ~/conky_clock_rc email@example.com:~/backup/wtfbox/configs rsync -aAxv ~/bin firstname.lastname@example.org:~/backup/wtfbox/configs rsync -aAxv /etc/fstab email@example.com:~/backup/wtfbox/configs rsync -aAxv /etc/apt/preferences firstname.lastname@example.org:~/backup/wtfbox/configs rsync -aAxv /etc/apt/sources.list email@example.com:~/backup/wtfbox/configs rsync -aAxv /var/log/apt/history.log firstname.lastname@example.org:~/backup/wtfbox/configs rsync -aAxv /etc/asound.conf email@example.com:~/backup/wtfbox/configs rsync -aAxv /etc/polkit-1 firstname.lastname@example.org:~/backup/wtfbox/configs exit 0
^ Couldn't you use an includes file, which has a list of the filepaths you want to rsync? Then use something like
rsync -av `cat /path/to/file` /destination/
There is also "--recursive --files-from="
Yeah I was thinking something like that. The above example is a bit unwieldy and I would like it to be simple enough to configure that it would keep stuff I have found to be a pain to set up backed up for me.
Ok. Worked on this some and got it working. Thanks for the tip @damo. I didn't quite get it to work that way but this did work, plus copied the directory hierarchy over nicely as well:
#!/bin/bash rsync -arAX --files-from=$HOME/.config/backup-conf / email@example.com:~/backup/wtfbox/configs exit 0
then the file list at $HOME/.config/backup-conf
/home/tknomanzr/.config/compton/ /home/tknomanzr/.config/openbox/ /home/tknomanzr/.config/tint2/ /home/tknomanzr/.conkyrc /home/tknomanzr/conky_clock_rc /home/tknomanzr/bin/ /etc/fstab/ /etc/apt/apt.conf.d/ /etc/apt/sources.list /var/log/apt/history.log /etc/asound.conf /etc/polkit-1/ /etc/systemd/
I can create any arbitrary list I want now. Also, if you want the file list to sit on the host as well, simply put a : in front of the --files-from=/path, like so:
This is setup to push files to the host.
I just back up in big chunks:
everything in /etc
everything in /home
most of /data
That just about covers it, except for
/etc isn't really all that big, and if there are some huge files or directories in /home or /data (if you use a /data that is) that you don't want to back up, you can make an "excludes" file to keep them out. I find this exclusive approach a bit easier on the nerves - there's less chance of forgetting to back up something important.
So, fwiw, my rsync line:
sudo rsync -av --exclude-from=$HOME/.config/user/backup_excludes /etc /boot/grub /data /home /media/backup/Desktop-backup
/media/backup is the mounted hard disk.
And, again fwiw, a typical "excludes" file:
/data/.Trash* /data/bigstuff /data/john/downloads/transmission /data/john/downloads/k3b /data/john/Virtualbox_vms /home/*/.mozilla/**/Cache /home/*/.local/share/Trash /home/*/.thumbnails /home/*/.cache /home/*/.gvfs /home/john/.dropbox-dist* /home/john/.dropbox/cache/* /home/john/.wine
Storage space is so cheap these days it's easiest to just throw it all in. As damo said, once you've run it the first time, the following backups will be pretty fast.
Last edited by userx-bw (2015-05-19 12:43:14)
"How can you learn how to fix it, if you don't break it first?
"the only way to get away with murder is - by killing time" swp 1997
"A computer is only as smart as the person using it"
"Just plug it in and see if it blows up, if not then take it apart and figure out how it works."