Search
Free Signup | Login
Search Articles
Topics
Article List
Article Archive
Relevant Links
How to Backup Scheduled Tasks On Windows
Location: BlogsRevindexWindows    
Posted by: revindex 7/13/2007 1:16 PM

Backup procedures tend to use the Windows Scheduler to backup files but IT Administrators often forget to backup the scheduled task itself. Here's how to backup your Windows Scheduled Tasks.

Copy Tasks

Windows Scheduled Tasks are located under C:\Windows\Tasks folder unless you installed your Windows core folders somewhere else. In the folder, you'll see a list of your jobs (the filenames actually end with a .job suffix and that's how Windows recognizes it as a special file). The job is a binary file and you cannot open it in notepad to view or edit. If you need to change the settings, you really have to right mouse on the job and get to the Properties dialog to affect it.

If you try to copy a specific job and paste it somewhere else on your system, Windows will disallow you. So the trick is to copy the entire Tasks folder and simply include all the jobs.

Backup Windows Scheduler Tasks Explorer

So with this information, using your backup software, you can now tell it to copy the Tasks folder to your media.

Restore Caveat

One design flaw in the Windows Scheduler is the need to specify a password to run a job. Should the password change, the scheduled job can no longer execute. You need to manually go into each task and re-key the password and is extremely error-prone; not to mention tedious.

Windows should have been smarter and simply impersonate the account so it wouldn't need a password. In contrast, traditional UNIX and Linux systems use Cron (crond) as a means to run scheduled jobs and they are never strongly coupled to an account or password. Cron is so simple that you can view and edit it as normal text file and backup/restore a cron is never a problem.

Coming back to Windows, what this means is you cannot restore the jobs from your backup media by pasting the jobs back into the Windows Tasks folder. The associated accounts and password will not match. Remember an account on Windows has an associated ID that is unique. Even if you recreate an account with the same User Name, it is not the same account as far as the Operating System is concerned.

So the proper way to do it is to re-create the scheduled jobs. However, since you did backup the jobs previously, you can at least use them as reference when you re-create the jobs.

Permalink |  Trackback

Comments (4)   Add Comment
Re: How to Backup Scheduled Tasks On Windows    By blah blah black sheep on 1/6/2010 3:21 PM
Good article. Tasks expiring when a user's password changes has been one of my greatest annoyances with Windows. In a corporate environment, folks are required to change their password every 30 days or so. Plus, many corporations have folks doing programming/automation work outside of the IS/IT departments who rely on scheduled tasks to automate ad-hoc reporting or ad-hoc system maintenance that's too trivial to really justify throwing IS/IT resources at. In my case, I'm a primary report runner for my dept, so I use my scheduled tasks to kick off MS Access db's that compile Excel reports. I also use task an MS Access db to go through various sql statements that double-check the SQL Server database integrity for snafu's and loopholes the IS/DBA department may have overlooked, acting like a checks-n-balance. I task scheduler MS Access db compactons, file backups, comp cleanup/defrag, and various other activities, too. Since I'm not in the IS/IT dept's, I don't get access to things like the SQL Reporting Services scheduler or such to automate this stuff for me. So, I have to fall back on my own computer, using task scheduler to get my computer to do the bulk of this in off-hours. Task scheduler is a very powerful tool, and it amazes me that more folks don't use it since it's so very easy to use. You don't have to program to use it. You can just drag/drop MS Access macro shortcuts to it and other things.

So it just amazes me that Microsoft hobbled it in the knees by making the tasks simply stop running when the user changes their password. And there's no easy way around it. You have to go into each task and update the password manually. Or, you can fight with your IT department to get an admin account on your machine that doesn't require password changes and set them up under that. But many IT dept's get paranoid about giving a user that kind of access, and question why the user is using task scheduler to begin with.

I learned a while back to store important files and such on the server, then just make links to it onto my desktop. That way if my comp blows up, I don't really lose anything important. However, I really would dread having to remember and rebuild all the tasks I have scheduled. Reading your article answered the question on how I can do that. And, again, it's sad that task scheduler is hobbled where you can't just drag/drop generic tasks in. I understand the need for security, but not being able to change ownership of tasks the way you can do with a file is bizarre.

Thanks for the article.

How to Backup of Scheduled Tasks of windows through TSM..?    By Arunkumar on 1/13/2010 12:54 AM
please help me..!

Re: How to Backup Scheduled Tasks On Windows    By Regan Dowe on 7/13/2010 7:07 AM
When you are in the scheduled task wizzard where it requests the user name type in SYSTEM and leave the password blank, it works for me. I use this command to document all of my tasks:

Schtasks.exe /Query /FO LIST /V >Schedules.txt

Re: How to Backup Scheduled Tasks On Windows    By R. Goers on 7/21/2010 4:42 PM
My work PC is locked down so that I cannot create a task as System, with a blank password. To get around this; I created a batch to "fix" my tasks after I create them, and make them all run as "system". Similar to the solution offered by Regan; I use “schtasks” to do the grunt work.

schtasks /change /tn "Task Name Here" /ru SYSTEM

Use quotes if the taskname contains spaces, otherwise, they are not needed.


Your name:
Title:
Comment:
Add Comment   Cancel