On Feb 20, 2007, at 2:46 AM, Eric Bollengier wrote: > Hi, > >> I'm working on writing a perl script that will backup volumes in my >> AFS cell by dumping them to a NFS share. I'm running this as a >> RunBeforeJob script using some of the variable expansion features of >> bacula to fill in the arguments to the script. I have a question >> regarding the behavior of the %s (since time) expansion: >> I'm doing full backups the 1st sunday of the month, differentials on >> sunday and incrementals every other day. If on the 2nd sunday of the >> month (1st differential of the month) will %s be expanded to the date >> of the full backup on the first sunday or will it be expanded to the >> date of the last job that ran (the incremental that ran saturday)? > > I have made this small test > > Job { > Name = "Client1" > JobDefs = "DefaultJob" > RunBeforeJob = "/bin/echo %s" > } > > and i have run this > run level=Full Client1 > Start time: 20-fév-2007 09:35:32 > => BeforeJob: 0000-00-00 00:00:00 > > run level=Incremental Client1 > Start time: 20-fév-2007 09:36:51 > => BeforeJob: 2007-02-20 09:35:32 > > run level=Differential Client1 > Start time: 20-fév-2007 09:37:24 > => BeforeJob: 2007-02-20 09:35:32 > > run level=Incremental Client1 > Start time: 20-fév-2007 09:37:42 > => BeforeJob: 2007-02-20 09:37:24 > > Everything works as expected i think. Good, this is what I hoped for (too bad I didn't think of that test...)
> >> I could not find any definitive answer in the manual and couldn't >> find it right away when looking at the source. >> >> Also is there any timeframe of when (or even if) the format of the >> timestamp will be user configurable? I saw some comments in lib/ >> btime.c about it and I for one would find this very handy. > > This is an ISO output, so, if you are using perl, you can convert > this very > easily (you can try Date::ParseDate) The issue I was having was with perl's Getopt::Long. The current format has a space in it and getopt was only seeing the date portion of the timestamp (and leaving the time in ARGV. I have worked around it but it lead to quite a bit of head scratching. (my workaround was to manually pop the time out of ARGV and append it to the value given by getopt. I tried putting quotes around the %s in the command but that didn't work. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users