Sponsored Content
Full Discussion: Cronjob Activation
Top Forums Shell Programming and Scripting Cronjob Activation Post 302163981 by Smiling Dragon on Sunday 3rd of February 2008 10:45:14 PM
Old 02-03-2008
Java

Quote:
Originally Posted by Raynon
Hi All,

I have set a cronjob to run a script at a frequency of 10 mins.
However, if the script takes more than 10 mins to complete, how will the cronjob behaves?
1) Does it ignore the current process and restart the whole process again?
2) Or does it stop to trigger the script again unless previous process has been completed?
Depends on your cron implementation but generally it will run another copy of the script 10 mins after the first one is started - regardless of how long the first run takes.

Solutions:
  • Make your script reentrant - ie write it such that it running multiple times at once isn't a problem.
  • Make your script aware of how many times it's currently running - ie create a lock file when it starts up and check for this every time you start.
  • Don't use cron, have the script run continuously and manage it's own scheduling - ie sleep 600
  • Don't use cron, get a better scheduler - depending on your enviornment, this could be something like anacron or control-m.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Wireless ipw2200 activation

hello ! i am trying to activate my wireless network card on my laptop currently running : 2.6.18-1.2869.fc6 , but an error msg appears "ipw2200 device eth1 does not seem to be present, delaying initialization." the same msg also appears at the start up process, when trying to bring up eth1. ... (4 Replies)
Discussion started by: XinU*
4 Replies

2. Forum Support Area for Unregistered Users & Account Problems

Did not receive activation mail

Hi Administrators, I've registered myself yesterday and have been waiting for my account to be activated. I've followed the instructions in the 'See this if you have an account but cannot post ' thread to request for an activation mail to be sent to my other email address, but still did not... (0 Replies)
Discussion started by: pl_cyber
0 Replies

3. Forum Support Area for Unregistered Users & Account Problems

Account Activation Problem

Hi, I got the username and activation code to my email id but when i click on the forum link and enter the activation code and username there then , It displays "We could not activate your account because this web address is not valid. Make sure that you have the entire address from the... (1 Reply)
Discussion started by: MIKU
1 Replies

4. Forum Support Area for Unregistered Users & Account Problems

Activation

can't activate (0 Replies)
Discussion started by: jamalwil7
0 Replies

5. Forum Support Area for Unregistered Users & Account Problems

Please send activation mail..

Hi, I have registered your site and i havent received any activation mail. please send me activation mail. Thanks & Regards, BVIJAY (1 Reply)
Discussion started by: bvijaycom
1 Replies

6. Forum Support Area for Unregistered Users & Account Problems

I need another activation email

Hi neo I registered yesterday,but i don't receive the activation email,can u send again? thanks! (1 Reply)
Discussion started by: swrd
1 Replies

7. Forum Support Area for Unregistered Users & Account Problems

Still waiting for activation email

Hi, I've been waiting for about 2 hours to receive my activation email but it hasn't arrived yet. I followed the 'resend activation information' link so I'm now expecting 2 activation emails, neither has arrived yet. How long do I expect this to take? I've tested my email account from other... (2 Replies)
Discussion started by: cambridge
2 Replies

8. Forum Support Area for Unregistered Users & Account Problems

Activation problems with new account.

I received the email describing how to acivate my new account (I'm using Outlook 2007). I tried clicking the URL given and was told "invalid web address". I tried copying and pasting both URL's - "invalid web address. Lastly, I tried typing in the URL - "invalid web address". There were no spaces... (1 Reply)
Discussion started by: ki6bxp
1 Replies

9. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Not able to post after activation

Hi... I got my account created and after activation I'm not able to create new posts or start a new thread. Can you help on how to start a new thread? Thanks. (1 Reply)
Discussion started by: Bang3095
1 Replies
DH_SYSTEMD_START(1)						     Debhelper						       DH_SYSTEMD_START(1)

NAME
dh_systemd_start - start/stop/restart systemd unit files SYNOPSIS
dh_systemd_start [debhelperoptions] [--restart-after-upgrade] [--no-stop-on-upgrade] [unitfile...] DESCRIPTION
dh_systemd_start is a debhelper program that is responsible for starting/stopping or restarting systemd unit files in case no corresponding sysv init script is available. As with dh_installinit, the unit file is stopped before upgrades and started afterwards (unless --restart-after-upgrade is specified, in which case it will only be restarted after the upgrade). This logic is not used when there is a corresponding SysV init script because invoke-rc.d performs the stop/start/restart in that case. OPTIONS
--restart-after-upgrade Do not stop the unit file until after the package upgrade has been completed. This is the default behaviour in compat 10. In earlier compat levels the default was to stop the unit file in the prerm, and start it again in the postinst. This can be useful for daemons that should not have a possibly long downtime during upgrade. But you should make sure that the daemon will not get confused by the package being upgraded while it's running before using this option. --no-restart-after-upgrade Undo a previous --restart-after-upgrade (or the default of compat 10). If no other options are given, this will cause the service to be stopped in the prerm script and started again in the postinst script. -r, --no-stop-on-upgrade, --no-restart-on-upgrade Do not stop service on upgrade. --no-start Do not start the unit file after upgrades and after initial installation (the latter is only relevant for services without a corresponding init script). NOTES
Note that this command is not idempotent. dh_prep(1) should be called between invocations of this command (with the same arguments). Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. Note that dh_systemd_start should be run after dh_installinit so that it can detect corresponding SysV init scripts. The default sequence in dh does the right thing, this note is only relevant when you are calling dh_systemd_start manually. SEE ALSO
debhelper(7) AUTHORS
pkg-systemd-maintainers@lists.alioth.debian.org 11.1.6ubuntu2 2018-05-10 DH_SYSTEMD_START(1)
All times are GMT -4. The time now is 08:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy