Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2006 10:40:36 +0200
From:      Niki Denev <nike_d@cytexbg.com>
To:        freebsd-stable@freebsd.org
Subject:   filesystem snapshot timestamp not correct?
Message-ID:  <200602281040.36507.nike_d@cytexbg.com>

next in thread | raw e-mail | index | archive | help
Hello,

I'm running a 6.1-PRE machine and have created the following 
scripts called from /etc/crontab :

0       0       *       *       *       root    /usr/local/sbin/make_snapshot.sh
15      0       *       *       *       root    /usr/local/sbin/purge_snapshot.sh

make_snapshot.sh :
#!/bin/sh
date=`date +%d-%m-%y`
/sbin/mksnap_ffs / /.snap/snapshot-$date

purge_snapshot.sh:
#!/bin/sh
/usr/bin/find /.snap -name "snapshot-*" -type f -ctime +7d -exec /bin/rm '{}' \;

so i will have snapshot created each day, and all snapshots older than 7 days will be deleted.

but i have more than 7 files in /.snap :
ls -la /.snap/
total 125460
drwxrwxr-x   2 root  operator        512 Feb 28 00:00 .
drwxr-xr-x  19 root  wheel           512 Feb 27 13:08 ..
-r--r-----   1 root  operator  536870984 Feb 28 09:36 snapshot-20-02-06
-r--r-----   1 root  operator  536870984 Feb 28 09:36 snapshot-21-02-06
-r--r-----   1 root  operator  536870984 Feb 28 09:36 snapshot-22-02-06
-r--r-----   1 root  operator  536870984 Feb 28 09:36 snapshot-23-02-06
-r--r-----   1 root  operator  536870984 Feb 28 09:36 snapshot-24-02-06
-r--r-----   1 root  operator  536870992 Feb 28 09:36 snapshot-25-02-06
-r--r-----   1 root  operator  536870992 Feb 28 09:36 snapshot-26-02-06
-r--r-----   1 root  operator  536870992 Feb 28 09:36 snapshot-27-02-06
-r--r-----   1 root  operator  536870992 Feb 28 09:57 snapshot-28-02-06

and most of them are with the same timestamp?

Any ideas? Probably i'm doing something wrong, but can't see it yet...

Regards,
Niki



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602281040.36507.nike_d>