Please Scroll Down to See Forums Below
napsgear
genezapharmateuticals
domestic-supply
puritysourcelabs
UGL OZ
UGFREAK
napsgeargenezapharmateuticals domestic-supplypuritysourcelabsUGL OZUGFREAK

batch file peeps, I need help

SoreArms

New member
We have a database that grows and changes daily, it has unfortunately corrupted and crashed a couple of times causing a good volume of lost work. As a result, someone was manually backing up the database once or twice per day. I recently moved into this department and the task has been handed to me, so I have written a simple batch file to create a back up of the database in my local drive (it's currently only 10MB+). For additional protection, in case the current file is already corrupt, I have it rename the existing backup file to backup2, then save the new one as backup1. I'm going to have this batch file run every 2 hours or so.

Anyways, here's my question, is there a command to have it save the file with a time and date stamp on the file name?
 
tumbleweed.gif
 
Seashell said:
I did similar stuff in school, but that was too many moons ago and I can't remember.. sorry..
we gonna meet up in B.C. or what?
 
yeah what OS b0r?

and by batch file, i assume you're talking about a shell script (if it's unix/linux)?

in bash, you could use something like:

date_stamp="$(date +%Y%m%d-%H%M%S)"
 
jackangel said:
yeah what OS b0r?

and by batch file, i assume you're talking about a shell script (if it's unix/linux)?

in bash, you could use something like:

date_stamp="$(date +%Y%m%d-%H%M%S)"
I bet this is a MS access DB on some windoze machine
 
Lestat said:
I bet this is a MS access DB on some windoze machine
yep

I'm using Windows XP, saving the database file over the network (old access style .mdb)

simple 3 line batch file

also, how do I make it run minimized or in the background? Every time the batch file runs, it opens up a commad prompt and steals focus from whatever I'm doing.
 
SoreArms said:
yep

I'm using Windows XP, saving the database file over the network (old access style .mdb)

simple 3 line batch file

also, how do I make it run minimized or in the background? Every time the batch file runs, it opens up a commad prompt and steals focus from whatever I'm doing.

Do a search for *.pif files.
Right click _default.pif file, choose Properties/Program/Run and choose minimized in the drop down. This should be the default settings for all newly opened DOS programs, BATs including.
 
Oh snap!

jackangle, check my l33t ski11z.. i called out not on the OS but the DB platform as well!


Sorry SoreArms, I'm not much of a windows programmer so I unfortunately can't help you much.
 
Top Bottom