GitXplorerGitXplorer
h

hardlinks-backup

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
d8fb4c1eda9c8a1466c9a3a332656b089ff750f0

README.md: added link to semaphore 2.0 status

hhervenicol committed 6 years ago
Unverified
4a4dea5ec77502885c49051abd28c5928397c653

semaphore v2 pipeline

hhervenicol committed 6 years ago
Unverified
c351ec3a1ce60ccbd2c8aa3b4531492b432ac94c

added bashate to travis tests

hhervenicol committed 6 years ago
Unverified
8bd2773120e5b6c8592e100bef7a79a2ff9a320c

added Travis status badge to README

hhervenicol committed 6 years ago
Unverified
9cd61774ad9dcfdf70657d5c71f74acb2fabc3ce

trying travis integration

hhervenicol committed 6 years ago
Unverified
7496103cd12c65d3c73357444ab141f214f0b8bc

added Semaphore status badge to README

hhervenicol committed 6 years ago

README

The README file for this repository.

Create rsync backups

Keep old versions using hard links

Interesting info/help: http://www.mikerubel.org/computers/rsync_snapshots/

Policy:

Keep a version per year.
  • Name: [backup_name].year.[YYYY]
  • Done during december. Not 31/12, too late in case of problem. Let's say 10/12.
  • command: cp -al [current] [YYYY backup]
  • Check if dir exists before
Keep 3 last months (01 of month)
  • Name: [backup_name].month.[month_name]
  • command: find path -name [backup_name].month.* --depth 1 --ctime +100 --exec rm {} ; && cp -al [current] [backup_name].month.[month_name]
Keep 4 last weeks (monday)
  • Name: [backup_name].week.{4..1}
  • command: delete 4, move 3 to 4 ... 1 to 2, cp -al [backup_name] to 1
Update current backup every day.
  • Name: [backup_name]

Notes:

create lock system for mount ro/rw:
  • each process that asks for rw puts a lock with its PID
  • each process that asks for ro removes its lock
  • when there the last lock is removed, we can effectively remount ro => create functions / a lib to handle this.

Don't forget checks for dir [ -d xxx ] before trying to overwrite / cp / mv ...

Sanity checks