Skip to content

draga79/cephfs-snp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

cephfs-snp

Create cephfs snapshots, manually or from cron.

Usage

# cephfs-snp
Usage: cephfs-snp <dir> (<tag>) (<limit>) (<seconds>)

  dir     │ create snapshot of <dir>
  tag     │ name the snapshot <tag>_<timestamp>
  limit   │ keep <limit> snapshots with this tag. 0 to disable
  seconds │ don't create snapshots before <seconds> have passed from last with this tag. 0 to disable

Examples

Manual

Snapshot of home

# cephfs-snp /home

Tagged snapshot of root

# cephfs-snp / preupgrade

Tagged snapshot of root, but keep maximum 10

# cephfs-snp / preupgrade 10

Cron

Hourly snapshot for one day, daily for one week, weekly for one month, and monthly for one year.

# cat > /etc/cron.hourly/cephfs-snp <<EOF
#!/bin/bash
/usr/local/sbin/$BIN /home hourly  24 3600
/usr/local/sbin/$BIN /home daily    7 86400
/usr/local/sbin/$BIN /home weekly   4 604800
/usr/local/sbin/$BIN /     weekly   4 604800
/usr/local/sbin/$BIN /home monthly 12 2592000
EOF
chmod +x /etc/cron.hourly/cephfs-snp

Based on btrfs-snp by Birger Monsen

Inspired by btrfs-snap by Ignacio Nunez Hernanz

About

Automatic cephfs snapshots made simple

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages