Highlighted
Absent Member.
Absent Member.
87 views

Cron Jobs or Scheduled task on Windows Servers

I have been asked by our command center if they can look at cronjobs jsut to read them for trouble shooting? is this possible?

If not, they would like to know if they put a text file of the cronjob in a folder can we read it for them. They want to be able to see it without going to the server. Maybe even drop it in the same folder where we read the configurationdocument cit?

 

The other question is about being able to list the scheduled tasks on a windows server?

 

Thanks in advance

Roger

Roger
0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Cron Jobs or Scheduled task on Windows Servers

Roger;

 

For UNIX, the command you're looking for would be crontab -l   (which lists the cron jobs for a user).  You would have to run crontab for each user (perhaps something like this:

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

This would go through the /etc/passwd file and get all users to run crontab for that user.  For windows, you can use the command line 'at' command:

 

c:\>at 08:00 /every:M,T,W,Th,F "cmd /c copy /Q c:\test.txt c:\test\test.txt"
Added a new job with job ID = 1

c:\>at
Status ID   Day                     Time          Command Line
-------------------------------------------------------------------------------
        1   Each M T W Th F         8:00 AM       "cmd /c copy /Q c:\test.txt c:\test\test.txt"

 

Running 'at' shows the scheduled windows jobs.

 

Best Regards;

 

Keith Paschal

HP UCMDB Support

Hope this helps,
Keith Paschal
UCMDB Worldwide Support Lead
Micro Focus Support
If you find this or any post resolves your issue, please be sure to mark it as an accepted solution."

Click the KUDOS star on the left to say 'Thanks'
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.