timestamping log files

SyncBack freeware has been retired and replaced with SyncBackFree. These old posts are being kept for reference only. SyncBack V3 freeware is no longer supported or available for download.

timestamping log files

Postby mccaa-metrology » Wed May 02, 2012 11:17 am

Is it possible to modify the timestamp.vbs given to timestamp log files?

Thanks
Ian
mccaa-metrology
Newbie
Newbie
 
Posts: 3
Joined: Wed May 02, 2012 9:37 am

Re: timestamping log files

Postby Dave Wilkins » Wed May 02, 2012 12:37 pm

Not from within the program, no - although it will work from the Programs > Run Before section's Test OK - because when the profile is run for real, the program will have already deleted the log file/s you want to rename (let's say Profile_Name_Log_Page1.html) before the Programs > Run Before section (thus, the script) is invoked. So it won't find anything to rename, and your file is already gone. And no, you can't run it afterwards or it will rename the file before you have a chance to see it (plus, the program could never open it again afterwards due to the rename)

For a stand-alone trigger (for example a shortcut or batch file), you could use it as written, thus (in Win7)

"C:\Program Files (x86)\2BrightSparks\SyncBack\timestamp.vbs" "C:\Program Files (x86)\2BrightSparks\SyncBack\Profile_Name_Log_Page1.html"

(preface with cscript or wscript if appropriate)


This will work as-is for profiles that generate one log page - the problem is (if using HTML logging) when they generate two or more. How do you pass the multiple names? And how do you know how many there were last time?

You could use it with TXT log files fine - but with HTML logging, I guess you'd need to figure out something special if multi-pages are involved, which is outside the scope of 2BS support. All I will say is that there's nothing stopping you calling the same script multiple times with a different argument each time - but not with multiple arguments on one command-line.

Anyone else is free to chime in, obviously
Dave Wilkins
2BrightSparks Staff
2BrightSparks Staff
 
Posts: 6963
Joined: Thu Jan 04, 2007 10:02 am

Re: timestamping log files

Postby mccaa-metrology » Tue May 15, 2012 7:46 am

Hi Dave. First of all thanks for the helpful reply. The suggestion works like a charm. However, shouldn't the timestamp be applied even when the profile is scheduled?

Thanks,
Ian
mccaa-metrology
Newbie
Newbie
 
Posts: 3
Joined: Wed May 02, 2012 9:37 am

Re: timestamping log files

Postby Dave Wilkins » Tue May 15, 2012 8:22 am

I've no idea which suggestion you are using, as I specifically said it won't work from within the program (the Test will work, but not when run for real, because by the time it is triggered 'live', the previous log file has already been deleted in readiness for a new one).

I did say you could run the script from a shortcut or batch file (manually), but no idea if you are trying to, or how you arranged for that to happen on a Schedule.
Dave Wilkins
2BrightSparks Staff
2BrightSparks Staff
 
Posts: 6963
Joined: Thu Jan 04, 2007 10:02 am

Re: timestamping log files

Postby mccaa-metrology » Wed May 16, 2012 10:46 am

My bad. sorry Dave. Got mixed up :)
mccaa-metrology
Newbie
Newbie
 
Posts: 3
Joined: Wed May 02, 2012 9:37 am


Return to SyncBack V3 (freeware)

Who is online

Users browsing this forum: No registered users and 3 guests

User Control Panel

Login

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 619 on Tue Jun 26, 2007 10:08 am

Users browsing this forum: No registered users and 3 guests