DragonFly commits List (threaded) for 2008-06
DragonFly BSD
DragonFly commits List (threaded) for 2008-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


To: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
From: Michael Neumann <mneumann@xxxxxxxx>
Date: Thu, 26 Jun 2008 18:15:35 +0200

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



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]