We would like to backup our ServiceDesk in case the unfortunate happens.
I have setup a scheduled task which uses the following:
osql -S server.mydomain.com -U sqlbackup -Q "BACKUP DATABASE ServiceDesk TO DISK = 'N:\ServiceDesk Backup\ServiceDesk.bak'"
Is there a way I can use the current date to rename the file? e.g ServiceDesk_101110.bak
I managed to solve it in the end by creating a bat script and setting it as a scheduled task. Below is what I cobbled together, might come in handy for someone else.
Code:@echo off cd C:\Program Files\Microsoft SQL Server\80\Tools\Binn osql -E -S 10.0.3.60 -Q "BACKUP DATABASE ServiceDesk TO DISK = 'C:\ServiceDesk Backup\ServiceDesk.bak'" cd "c:\serviceDesk Backup" for /f "tokens=1-4 delims=/ " %%b in ('date /t') do (set day=%%b& set month=%%c& set year=%%d) set jdate=%day%-%month%-%year% ren ServiceDesk.bak %jdate%.bak COPY /Y "C:\ServiceDesk Backup\%jdate%.bak" "\\storage\ServiceDesk Backup$\"
There are currently 1 users browsing this thread. (0 members and 1 guests)