Skip to content

Just a wrapper script for backing up stuff using anacron and rsync.

Notifications You must be signed in to change notification settings

iiska/anacron-rsync-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple rsync + anacron setup for syncing backups

Just a wrapper script for backing up files using rsync and anacron.

Basic setup

Edit file /etc/anacrontab and add task for running backup.sh from your desired source (eg. your home directory) to a backup destination.

# Example /etc/anacrontab

SHELL=/bin/sh
PATH=/bin:/usr/bin

RANDOM_DELAY=45
START_HOURS_RANGE=3-22

# period in days | delay in minutes | job-identifier | command
1 5 rsync.backup nice ~user/bin/backup.sh ~user/ user@nas:/mnt/backups

Excluding unwanted files

Backup script will look source directory and $HOME of user running the script for .rsync-excludes file listing patterns for files which should be excluded.

See rsync-excludes.sample for example and documentation for --exclude-from option in rsync manpage for more info.

Restoring backups

Restoration could be done by simply copying individual files from your backup destination or by syncing whole directory using backup destination as a source.

Example:

$ rsync -av user@nas:/mnt/backups ~user/

How about incremental snapshots

This setup only syncs file changes around and doesn't implement any sophisticated features like incremental backup.

In my own home setup incrementals are achieved by using periodical filesystem snapshots with ZFS in FreeNAS box.

About

Just a wrapper script for backing up stuff using anacron and rsync.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages