[OpenIndiana-discuss] Last change in zfs filesystem

Christian Meier meierch75 at gmail.com
Tue Sep 25 08:00:38 UTC 2012


Hello Armin
> Hello, is there an easy way wo find out when the last update occured
> to an zfs filesystem, my goal is to only make a backup of a filesystem
> when something has changed. At this time i make it in a command pipe
> with "find ... | sort ... | head | awk" what takes a lot of time if
> the filesystem holds a lot of files. 

you may use ZFS snapsots and the zfs diff command

S0013(root)#~> zfs list | grep V0002_PA_arch/data/apsys_dbprod
V0002_PA_arch/data/apsys_dbprod                       2.73M   358M 
2.71M  legacy
V0002_PA_arch/data/apsys_dbprod at 2012-09-24_Back         22K      -  2.71M  -
V0002_PA_arch/data/apsys_dbprod_arch                  1.95M   358M 
1.93M  legacy
V0002_PA_arch/data/apsys_dbprod_arch at 2012-09-24_Back    20K      -  1.93M  -
S0013(root)#~>  zfs diff V0002_PA_arch/data/apsys_dbprod at 2012-09-24_Back
V0002_PA_arch/data/apsys_dbprod
S0013(root)#~> touch /zones/V0002/root/apsys/dbprod/newfile
S0013(root)#~> touch /zones/V0002/root/apsys/dbprod/newfile-2
S0013(root)#~>  zfs diff V0002_PA_arch/data/apsys_dbprod at 2012-09-24_Back
V0002_PA_arch/data/apsys_dbprod
M       /zones/V0002/root/apsys/dbprod/
+       /zones/V0002/root/apsys/dbprod/newfile
+       /zones/V0002/root/apsys/dbprod/newfile-2


Regards Christian





More information about the OpenIndiana-discuss mailing list