waster Posted October 24, 2005 Share Posted October 24, 2005 I wondered if anyone can help me! I have written a script to automate NT backup on a Windows 2003 Server. I want the file name that I am backing up to is based on todays date. My script is very simple and looks like the one below: Runwait ("ntbackup backup systemstate /f c:\Test.bkf") exit I want to substitute the c:\test.bfk with todays date, for example 24102005.bkf. Is this easy? Does anybody have any suggestions as to what I can do. Link to comment Share on other sites More sharing options...
MHz Posted October 24, 2005 Share Posted October 24, 2005 That is what macro's are for... Runwait ("ntbackup backup systemstate /f " & @MDAY & @MON & @YEAR & ".bkf") Link to comment Share on other sites More sharing options...
waster Posted October 24, 2005 Author Share Posted October 24, 2005 Many thanks that seems to work! I must admit I had been trying with the macros, just I had the syntax wrong, thanks. Link to comment Share on other sites More sharing options...
MHz Posted October 24, 2005 Share Posted October 24, 2005 Your welcome Link to comment Share on other sites More sharing options...
Confuzzled Posted October 24, 2005 Share Posted October 24, 2005 For enhanced sorting purposes could I suggest @YEAR & @MON & @MDAY & ".bkf"? Link to comment Share on other sites More sharing options...
laurin1 Posted January 27, 2006 Share Posted January 27, 2006 Here's a more complex script I wrote, that works pretty darn good for multiple backup jobs. Requires include of the UnixTime.au3 and Array.au3 UDF's. Extract the zip, and modify the Backup.ini file to fit your backup requirements. Backup.zip DataDir is where the backup set is located. You'll need to create and save the backup set from NTBackup first. BackupLocation (where you want the backup to be saved, when doing disk to file backups.) ***PoolFile: Set this to a file name or tape media name for tapes (ex. mine is 4mm DDS.) The logarray function isn't working. The script works great, but I didn't design it to be portable, so you might need to tweak it some more. If you have trouble getting it to work, let me know. Keith Davis MCSA, ZCE, A+, N+ http://www.laurinkeithdavis.com Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now