rsnapshot.sh is a very simple shell script to do backups similarly to "Back In Time" or Apple's "Time Machine"; teletime.sh is a complementary simple script to run programs "in the past" meaning setting environmental variables so that programs see your backed up HOME folder instead of your actual one.
rsnapshot.sh backups to your location of choice, e.g. your HOME folder. It uses rsync and cp.Go ahead and install rsync (you probably already have it). Edit parameters in rsnapshot.sh, apply "chmod +x rsnapshot.sh" and run the script. Now you have nice little backup system.
Running it each 10 minutes will produce subfolders inside your backup folder, example:
2015-08-28--18-25 2015-08-28--18-36 2015-08-28--18-47 2015-08-28--18-57 2015-08-28--19-08 latestHere each subfolder corresponds to a snapshot of your HOME
To run backups periodically you could use 1) systemd (if you have it) 2) cron, or 3) plain bash.
With systemd, edit rsnapshot-sh.timer and rsnapshot-sh.service and put them to a folder for User level of systemd. I use /home/YOURUSER/.config/systemd/user/.
Then you enable and run timer unit with:
systemctl --user enable rsnapshot-sh.timer systemctl --user start rsnapshot-sh.timerInstall cron and add crontab
crontab -eThis could be usefull if you plan to run periodical backups only occasinally e.g. only when you code and want to track versions without using versioning systems or if you cannot install cron.
To run it each 10 minutes (60*10=600 seconds) do
watch -n 600 ./rsnapshot.shor
while true; do ./rsnapshot.sh; sleep 600; doneTo run programs in modified environment so backed up HOME folder appears as actual one to them.
Tricking python:
bash teletime.sh 2015-08-28--00-59 pythonTricking bash:
bash teletime.sh 2015-08-28--00-59 bashTricking ipython notebook:
bash teletime.sh 2015-08-28--00-59 'cd ~/YourPathTo/FolderOfChoice && ipython notebook'
You could easily search various things in your logs. For instance, you might want to search for all deleted files with:
grep "*deleting " /run/media/ilya/BACKUPHDDNAME/backup/ilya/*/rsync.loghttps://wiki.archlinux.org/index.php/Rsync
https://wiki.archlinux.org/index.php/Cron
https://wiki.archlinux.org/index.php/Systemd/Timers
https://wiki.archlinux.org/index.php/Systemd/User
http://learnxinyminutes.com/docs/bash/