Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MegaSync is my 30 year old simplistic backup program using rsync + cp -l

It predates filesystem snapshotting and other fancy things.

But describing it takes more characters that its code :)

It takes a list of hostname:ssh_port:/directory

example backup.list file

  # backup.list file
  # host:ssh\_port:/directory
  #
  # webserver
  www.toronto.nohats.ca:22:/etc
  www.toronto.nohats.ca:22:/usr/local
  # nameservers - ssh runs on port 2222
  ns0.nohats.ca:2222:/etc
  ns0.nohats.ca:2222:/var/nsd
  ns0.nohats.ca:2222:/var/log
  ns1.nohats.ca:2222:/etc
  ns1.nohats.ca:2222:/var/nsd
  ns1.nohats.ca:2222:/var/log

example excludes file

  # backup.exclude file
  core.*
  core
  btmp
  dev/
  proc/

How it works

MegaSync will create a Current directory for each listed entry with the latest backup and create linked trees to older dates, so you have dated directories that are "full directories" and cp -l will ensure you have no duplicate files in all your daily trees. That is, on your backup host you can "cd" into the backups of your webserver and look at how your /var/www/html directory looked on the 4th by just checking /vol/backup/www.nohats.ca/04/var/www/html/index.html

You will end up with 30 (or 28/29/31) days of "live trees" after which it will start overwriting the 30 day old backup, eg:

   /vol/backup/ns0.nohats.ca/Current
   /vol/backup/ns0.nohats.ca/01
   /vol/backup/ns0.nohats.ca/02
   [...]
   /vol/backup/ns0.nohats.ca/31

Within those trees any unchanged files are hardlinked. So be careful of appendonly log files that are never rolled because you will be creating 31 copies of it :)

Usage: MegaSync

or if you want a subset of your listed entries only:

   MegaSync ns0

Running without arguments is ideal for daily cron jobs.

About

my 30 year old rsync with cp -l backup script

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages