View Single Post
  #2  
Old November 9th, 2004, 01:12 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: Request for auto backup of turn files

I do these backups in a very simple fashion: by running a script on Dom2 start (and on hosting too - for SP).

Here's the script: save_script.awk
Code:

BEGIN {
timestamp_file = "Last-total-save-timestamp.txt";
t = systime();
stamp = strftime("%Y%m%d-%H%M%S",t);
stamp2 = strftime("%Y-%m-%d",t);
saveAll = 1;
if ((getline Last_stamp < timestamp_file) > 0)
{
if (stamp2 == Last_stamp)
saveAll = 0;
}
close(timestamp_file);

if (saveAll)
{
cmd = sprintf("zip -r save-all-%s * -i@save.lst",stamp);
print stamp2 > timestamp_file;
}
else
cmd = sprintf("zip -r -t %s save-%s * -i@save.lst",Last_stamp,stamp);
system(cmd);
}



You'd need to insert
gawk -f save_script.awk into your Dom2 startup

And you'll need save.lst:
Code:

*/ftherlnd
*/*.2h
*/*.trn


That's the only Dom2-specific file.
Reply With Quote