1.

Solve : How to backup a file automatically?

Answer»

Is there a WAY I can BACKUP a file automatically, say once a day? I was thinking I could use Windows XP Scheduler with a batch file. The batch file would copy and rename the file including the date. Any SUGGESTIONS where to start?First are u familiar creating any batch file?This batch file will rename, append the date and copy a file.

Code: [Select]
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do SET today=%%c%%a%%b
copy drive:\path\filenameA.ext drive:\path\filenameB-%today%.ext

Note: the date is formatted YYYYMMDD. Flip the variables if you want SOMETHING different.

Change drive, path, filenameA, filenameB and ext to something valid.

Once you've tested the batch file from the command line and all is well, open up the task scheduler and schedule the job.

Good luck. Thanks, worked like a charm. Here's the code for others to use. Becareful not to put a space on the end of the first line.

for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set today=%%c%%a%%b
copy C:\progra~1\SageTV\SageTV\Wiz.bin C:\progra~1\SageTV\SageTV\wiz-%today%.bin
copy C:\progra~1\SageTV\SageTV\Sage.properties C:\progra~1\SageTV\SageTV\Sage-%today%.properties



Discussion

No Comment Found