bmdixon Posted June 15, 2009 Posted June 15, 2009 Hi, I'm trying to get a scheduled task to run a perl script that performs our backup. When i run the script manually (double click) it works fine, and backs everything up properly. When i schedule it however, it doesn't work and exits with error code 0x2. I've looked on google and this seems to indicate "file not found". I've tried changing permissions, folders and user accounts but it still does this. My current theory is that it is failing on these use lines at the top: use File::Path; use File::Copy; but why it works fine when run outside of the scheduled task i don't know! Can anyone shed any light on why this might be failing?!
bmdixon Posted June 16, 2009 Author Posted June 16, 2009 hi, i've tried several different users, and put the password in very carefully to check it but still no joy
Mcshammer_dj Posted June 16, 2009 Posted June 16, 2009 check permissions on the tasks and on the files, have you used the same user for each
bmdixon Posted June 16, 2009 Author Posted June 16, 2009 yeah i've checked that. All 3 accounts i used were domain admin accounts, and have full permisisons over the tasks, the backup script folder (and files) and the files to be backed up. Running the script manually (not through scheduled tasks) works fine though
soapyfish Posted September 21, 2009 Posted September 21, 2009 I am getting the exact same problem with a very basic script that maps a drive copies some file and then removes the drive mapping. Again it works fine if I run it by hand and fails if I schedule it. It started failing on Friday 18th September for no reason at all ??
bmdixon Posted September 21, 2009 Author Posted September 21, 2009 I'm not quite sure why this happens but it started working when there were no other users logged into the server. Make sure that everyone is logged off the server (remotely or locally) and see if it works then.
mwnci Posted September 21, 2009 Posted September 21, 2009 I'm aware of an issue on server 2008 whereby if the script has quotation marks in it, it won't run, even if the script works perfectly when run manually. There is more info on it here: A scheduled task does not run as expected if a command-line argument is enclosed in quotation marks on a computer that is running Windows Server 2008 or Windows Vista SP1
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