.Dd May 6, 2007 .Dt SNAP 8 .Os .Sh NAME .Nm snap .Nd FreeBSD UFS2 Snapshot Management Tool .Sh SYNOPSIS .Nm .Op Fl p .Op Fl m .Op Fl h .Op Fl c Ar config_file .Op Ar filesystem ... .Sh DESCRIPTION The .Nm utility helps to either .Pa periodically or .Pa manually create snapshots. .Pp The options are as follows: .Bl -tag -width indent .It Fl p Perform .Pa periodic task. It can only be used on the hour, otherwise nothing will happen. If .Dq atHour is given in the configuration file, then .Nm will only run on the specified hour. When this flag is not given, it is considered as a .Pa manual snapshot creation. .It Fl m List manually created snapshots and then exit. .It Fl h Show the help message. .It Fl c Ar config_file Specify the pathname of an alternative configuration file; The default is .Pa /root/snap/snap.conf . .El .Pp The .Nm utility reads its configuration file when it starts up. If .Pa filesystems are given and corresponding entries in the configuration file can be found, .Nm will only handle these filesystems and ignore their .Dq enable flag in the configuration file. .Pp All snapshot files are created with the local creation time as their filename. In periodic maintaining task, three types of periodic snapshots, namely, hourly, daily, and weekly, are created and rotated according to the settings in the configuration file. They are also hard-linked to .Dq nicknames , for example, the last hourly snapshot is hard-linked to .Pa hour.0 . .Sh EXAMPLES The following command creates snapshots manually according to the configuration file. .Pp .Dl snap .Pp To perform periodic maintaining, invoke .Nm in .Pa /etc/crontab as .Pp .Dl 0 * * * * root /path/to/snap -p .Pp since periodic maintaining requires to be performed on the hour. .Pp To manually create snapshots on filesystem / and /home and /var only: .Pp .Dl snap / /home /var .Pp This command will ignore the .Dq enable flag in the configuration file. If, say, /var is not found in the configuration file, nothing would happen. .Pp We can list manual created snapshots on filesystems / and /home: .Pp .Dl snap -m / /home .Pp or also specify an alternative path for the configuration file: .Pp .Dl snap -m -c /tmp/gg/snap.conf / /home .Sh FILES .Bl -tag -width /root/snap/snap.conf -compact .It Pa /root/snap/snap.conf configuration file .It Pa hour.0 last hourly snapshot .It Pa daily.0 last daily snapshot .It Pa week.0 last weekly snapshot .El .Sh SEE ALSO .Xr mount 8 , .Xr crontab 5 , .Xr mdconfig 8 , .Xr snapshot 8 .Sh AUTHORS This manual page was written by .An Wu Chin-Hao wchunhao@cs.nctu.edu.tw .