How to Import/Export a scheduled task

It is very important when you want to move your server from one web host to another one and you wish to move your scheduled task hosted from Windows Server.

In this case, I will take Windows Server 2008 as an example:

Export Scheduled Task,
1. Open Task Scheduler or run taskschd.exe.
2. Select the Task that you wish to export and hit on the Export link from the right bar.
3. Save the xml file.

Import Scheduled Task,
1. Open Task Scheduler or run taskschd.exe.
2. Click the Import link from the right bar and you will now see the Task created.

Schedule backup for MSSQL to remote computer

If you familiar with MSSQL maintenance plan and ever configured backup through this tool and you should know that to backup the MSSQL database to remote computer, you have to configure Log On setting from services.

Okay, today we assume that we couldn’t allow to change the setting from Log On setting and wish to set the schedule backup, we could use maintenance tool and batch command to schedule it.

Firstly, create a maintenance plan from MSSQL, then select “Back Up Database Task”. From Database(s) option, select your database name, you may specify the directory that wish to backup. From this article we make it to C:\mssql\backup\.

Next, create a batch file named mssql_backup.bat and insert command as below.

xcopy C:\mssql\backup "\\remote_server\c$\backup" /e /i /h /y

Where remote_server is your remote server name and you would like to place it to C:\backup.

Lastly, create Windows Task Scheduler and configure the mssql_backup.bat to run daily or weekly as your wish.