cvs commit: src/sbin/hammer Makefile cmd_snapshot.c hammer.h hammer.c

Michael Neumann mneumann at ntecs.de
Thu Jun 26 09:15:35 PDT 2008


Matthew Dillon wrote:
    Have it create a name based on the current date and time and allow the
    prefix to be specified on the command line using %s:
    hammer snapshot <softlink-dir-in-filesystem>
    hammer snapshot <filesystem> <softlink-dir>
    So:

	hammer snapshot /usr/obj "/mysnapshots/obj-%s"

	-->  /mysnapshots/obj-20080625

	hammer snapshot /usr/obj "/mysnapshots/obj-%s-%s"

	-->  /mysnapshots/obj-20080625-1013

	hammer snapshot /usr/obj "/mysnapshots"

	--> /mysnapshots/snap-20080625-1013

    Or something like that.
Matt, I went with strftime for ultimate flexibility on how
the timestamp is formatted, so that the following works fine:
  hammer snapshot "/mysnapshots/snap-%Y-%m-%dT%H:%M:%S"
  hammer snapshot /obj "/mysnapshots/obj-%Y-%m-%dT%H:%M:%S"
Regards,

  Michael





More information about the Commits mailing list