Lighthouse      Zap's Digital Lighthouse
   


About
Zap's Digital Lighthouse is
a Blosxom weblog for our digital outpost on the Internet

For info
info@rax.org


Useful links:
Google
Cyberpresse
The Reg
Slashdot
FreeBSD
LinkedIn
Twitter
Boursorama
RAX
zap
Soekris
xkcd
AirFrance
Wiki soekris
Wikipedia
Wiktionary
ACME
blosxom

Categories:
/FreeBSD (27)
/admin (3)
/blosxom (6)
/games (3)
/hardware (17)
/inet (4)
/misc (37)
/notwork (2)
/software (11)
/tech (1)

Archives:
 2023 (1)   
 | June (1)
 2021 (2)   
 | January (2)
 2020 (2)   
 | December (1)
 | September (1)
 2019 (2)   
 | November (1)
 | July (1)
 2018 (6)   
 | December (1)
 | November (3)
 | January (2)
 2017 (4)   
 | December (2)
 | January (2)
 2016 (3)   
 | November (1)
 | October (1)
 | January (1)
 2015 (9)   
 | December (2)
 | November (1)
 | October (1)
 | June (1)
 | May (2)
 | February (1)
 | January (1)
 2014 (9)   
 | December (1)
 | October (1)
 | September (1)
 | August (3)
 | May (2)
 | April (1)
 2013 (20)   
 | October (3)
 | June (4)
 | May (2)
 | April (7)
 | March (1)
 | January (3)
 2012 (60)   
 | December (4)
 | October (1)
 | July (5)
 | June (7)
 | May (1)
 | April (6)
 | March (3)
 | February (14)
 | January (19)
 2011 (3)   
 | December (1)
 | November (2)
 2008 (1)   
 | October (1)


Blosxom

       

home :: FreeBSD :: zfs-snapshots

Mon, 01 Apr 2013

Accessing ZFS snapshots

I make hourly snapshots of the ZFS filesystems on my home server. This is quite easy using a small script called "zfs-snapshot.sh" (which I found on the web) and the following lines in root's crontab file:

# perform zfs snapshots
3  *  *  *  *   /root/zfs-snapshot.sh pool0 hourly 25
13 0  *  *  *   /root/zfs-snapshot.sh pool0 daily  32
23 0  *  *  0   /root/zfs-snapshot.sh pool0 weekly 60

7  *  *  *  *   /root/zfs-snapshot.sh datapool hourly 25
17 0  *  *  *   /root/zfs-snapshot.sh datapool daily  32
27 0  *  *  0   /root/zfs-snapshot.sh datapool weekly 60

This keeps a day's worth of hourly snapshots, a month's worth a daily backups, and a year's worth of weekly backups (I should perhaps also keep a decade's worth of annual backups?!).

This is useful and can be really easily accessed... For example, I restored "/usr/local/lib/libintl.so.9" from a recent snapshot by doing:

cp /.zfs/snapshot/daily.5/usr/local/lib/libintl.* /usr/local/lib

Accessing snapshots through .../.zfs/snapshot is quite handy.

PS. For the record, the zfs-snapshot.sh script is here.

/FreeBSD | Posted at 15:42 | permanent link