- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: scheduling a shell script
Operating System - Linux
1753656
Members
5728
Online
108798
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2006 03:37 AM
тАО01-22-2006 03:37 AM
Re: scheduling a shell script
Hi James,
I had scheduled the job home/sksonkar/shiv.sh|at 0200 tomorrow
it exexuted successfully today morning.
I believe it will not execute continuously tomorrow and day after.
For making it to run continuoulsy do i need to put the at command in the script shiv.sh and run "shiv.sh &" or run with the command "nohup shiv.sh" as a background process ?
Is there a command to view the details of the jobs scheduled via at command ?
Thanks,
Shiv
I had scheduled the job home/sksonkar/shiv.sh|at 0200 tomorrow
it exexuted successfully today morning.
I believe it will not execute continuously tomorrow and day after.
For making it to run continuoulsy do i need to put the at command in the script shiv.sh and run "shiv.sh &" or run with the command "nohup shiv.sh" as a background process ?
Is there a command to view the details of the jobs scheduled via at command ?
Thanks,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2006 03:56 AM
тАО01-22-2006 03:56 AM
Re: scheduling a shell script
Hello Shiv:
No, the script will not automatically execute again as setup.
One crude way to make continuous execution happen, as already noted, would be to place the body of your script's instructions in a loop that once executed, sleeps for 86,400 seconds. The drawback, of course, is that if your script ever fails, it's done until you manually intervene.
Another way to cause successive runs would be to use 'at' as you have, and add, as the *last* instruction for your script to re-schedule itself:
# at -f /home/sksonkar/shiv.sh now + 1 days
See the manpages for 'at' for more options!
Lastly, if you want to run a task with regularity, you should 'cron' it. This is what 'cron' is designed to do. You can run a process every day, many times a day, only on selected days of the week, etc. etc.
Please consult the 'crontab' manpages. For example, to run your script every 24-hours you would create a crontab entry (using the user account you want to use) like:
30 2 * * * /home/sksonkar/shiv.sh
This would run your script every day at 02:30
Regards!
...JRF...
No, the script will not automatically execute again as setup.
One crude way to make continuous execution happen, as already noted, would be to place the body of your script's instructions in a loop that once executed, sleeps for 86,400 seconds. The drawback, of course, is that if your script ever fails, it's done until you manually intervene.
Another way to cause successive runs would be to use 'at' as you have, and add, as the *last* instruction for your script to re-schedule itself:
# at -f /home/sksonkar/shiv.sh now + 1 days
See the manpages for 'at' for more options!
Lastly, if you want to run a task with regularity, you should 'cron' it. This is what 'cron' is designed to do. You can run a process every day, many times a day, only on selected days of the week, etc. etc.
Please consult the 'crontab' manpages. For example, to run your script every 24-hours you would create a crontab entry (using the user account you want to use) like:
30 2 * * * /home/sksonkar/shiv.sh
This would run your script every day at 02:30
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2006 04:04 AM
тАО01-22-2006 04:04 AM
Re: scheduling a shell script
Hi (again) Shiv:
Oh, I forgot to answer your last question.
To see tasks (if any) that have been scheduled via 'at', login as the user that scheduled them and do:
# at -l
To remove one, use:
# at -r
...with the job-id seen in 'at -l'. For instance:
# at -l
job 1138035079.a at Mon Jan 23 11:51:19 2006
# at -r 1138035079.a
Since you will ask, (good!) I'll tell you ahead of time that the jobid, here "1138035079" is the Unix epoch time --- the number of seconds since January 1, 1970. The jobid of 'at' is "translated" in the output. That is, "1138035079" is your localtime as shown: Mon Jan 23 11:51:19 2006.
Regards!
...JRF...
Oh, I forgot to answer your last question.
To see tasks (if any) that have been scheduled via 'at', login as the user that scheduled them and do:
# at -l
To remove one, use:
# at -r
...with the job-id seen in 'at -l'. For instance:
# at -l
job 1138035079.a at Mon Jan 23 11:51:19 2006
# at -r 1138035079.a
Since you will ask, (good!) I'll tell you ahead of time that the jobid, here "1138035079" is the Unix epoch time --- the number of seconds since January 1, 1970. The jobid of 'at' is "translated" in the output. That is, "1138035079" is your localtime as shown: Mon Jan 23 11:51:19 2006.
Regards!
...JRF...
- « Previous
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP