Solved

Task Scheduler Oddity

Posted on 2015-02-09
9
180 Views
Last Modified: 2015-02-25
I have WSFTP client on a 2008 Server x64 SP2.
I have scripts created with WSFTP that periodically upload and download files from a offsite ftp site.
I have scheduled tasks (in Windows Task Scheduler) pointing to the .scp scripts.

This process I have on a few other servers - and it runs great. No problems.

With this installation - if you allow the tasks to fire off on their own - triggered by time (every 30 minutes, etc) youc an see the ftpscrpt.com come up in Task Manager - showing that Task Scheduler successfully is calling the script - but then - nothing. Hangs. Forever.

If you Display All Running Tasks in Task Scheduler - it shows all of them - Run Duration hours long.

Sounds like the scripting isn't right or something, right? Or permissions to the directories it locally trying to pull or push to/from aren't allowing it to complete, right?

Here's the kicker - I have the tasks running with the domain admin user. If I log into that server with the same user, right click one of the scheduled tasks that is stuck and click Run - it works fine. Shoot - if I log into the server with a non admin user and right click and run

I've seen issues where you point a scheduled task to a batch file and it doesn't' work but if you run the batch file manually it does - but not where a scheduled task will not complete the process when triggered on a timer but will if manually requested. Its not even a difference in user rights - its the same user.

I have uninstalled WSFTP and booted and reinstalled  - even changed the version to a newer version - modified the tasks to use the local admin (and then eventually put it back) - checked permissions on each folder being called on etc.

-- I'm lost. Ideas?

(I don't want to make this but so long but I will give more information on this - this server and the exact process and scripts - worked fine until the ftp site was given a new Security Certificate. I found out about this on one of my other servers when I noticed ftpscrpt was hung. Eventually I logged into WSFTP GIU and manually connected to the site and was prompted to Accept a New Security Certificate - which I did and and viola - worked fine. So knowing this - I hit all my other servers (they all script to the same ftp site) and accepted the certs there too. If it is related to the new cert - I can't understand why it will only run manually - it shouldn't run at all. And when I log into the WSFTP GUI on this server and connect now - no prompts are given and I can move through the site directories just fine.)
0
Comment
Question by:vpnsol123
9 Comments
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 40600465
Shot in the dark: check the user under which the script runs when fired from task scheduler. If it's local system, then that's your problem. Change it to the user you use when running the task manually.

HTH,
Dan
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 40600567
I suggest deleting the task and re-creating it
0
 
LVL 38

Expert Comment

by:Hypercat (Deb)
ID: 40600791
Other silly things to check - make sure the task is set to run whether the user is logged on or not, and also that it's set to highest privilege.
0
 

Author Comment

by:vpnsol123
ID: 40600799
Thanks - the tasks are running as domain admin and even tried local admin - they still hang when they fire off automatically. I also have deleted a few of them previously (7 of them) and created again - even those are hanging.
I tried turning on logging with WSFTP to see if that woudl give any indication of what may be up. 1. WSFTP doesn't include date and time in logging that I can see - so that makes it a bit harder 2. If starting with clean logs and allowing the tasks to fire off on their own - the ones that hang do not create a log so its obvious the process isn't finishing.
0
Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

 

Author Comment

by:vpnsol123
ID: 40626312
Just to add to this:

I took the 38 to 40 tasks and disabled them. I logged into another 2008 R2 box and installed a trial of WSFTP. I took the .scp files from the original server - copied them to a central directory on the new server and modified the paths to be \\orginalserver\.... and then created new Windows Scheduled Tasks to run against the scp. Exact same result. They will run when I right click on the task and manually tell it to run - and complete just as they should - just if left alone to let the timer fire it off - they hang. Here's what I've noticed. They don't always hang and its not always the same ones hanging. I also tried the option to end the task when it runs over an hour in each scheduled task. What the end result of that is that when you look at running tasks - you only see any running less than an hour but the exe (ftscrpt.com) never ends so I'm left (depending on the time that I am away from the server) with 100 ftpscrpt.com's running just taking up more and more overhead on the server. I will add as I figure out more.
0
 
LVL 38

Accepted Solution

by:
Hypercat (Deb) earned 500 total points
ID: 40626625
I'm wondering (because of a prior experience I had with trying to run an .EXE directly from a schedule task) if it would work if you created a simple batch file to run the script, and then ran the batch file from the scheduled task.  I know it sounds (and IS) convoluted, but you could give it a try and see if it works any better.
0
 

Author Comment

by:vpnsol123
ID: 40626704
You know what's funny? About an hour before your suggestion I realized but that might be the best way of getting around this and created main batch files that point to the scripting files that I could set up scheduled task to fire off a different kind information and thus far it looks to be working. It doesn't shed light on what's really is happening but at this point too much time is lost. I'll let you know but I believe this will be the workaround. Good job. Will keep you in the loop.
0
 

Author Comment

by:vpnsol123
ID: 40630882
hypercat - that worked. Have no idea WHY I had to do it that way but its working. Thanks All.
0
 
LVL 38

Expert Comment

by:Hypercat (Deb)
ID: 40630895
Glad it worked!  This is one of the great things about EE - sharing those little weird but effective techniques and workarounds that you find out about purely by trial and error over the years...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now