Run script no more than twice daily WITHOUT cron


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run script no more than twice daily WITHOUT cron
# 8  
Old 08-13-2018
You can do this, but be careful that you don't run into a race condition, if the script is started twice at nearly the same time. Also, if someone deletes or manipulates your "control file", this protection is lost.

Other possibilities are to use the
Code:
at

command, or use a master script, which starts your script exactly twice. Of course in this case you have to ensure that the master script itself is not run twice.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

/etc/cron.daily script is not being executed

Hi All I have created a file in /etc/cron.daily on redhat linux 7.3 version host called applicationscript cat applictaionscript #!/bin/bash /prod/data/routine.sh cat /prod/data/routine.sh #!/bin/bash #details regular=/prod/data/jboss/logs backup=/prod/data/logs #echo "Moving logs"... (3 Replies)
Discussion started by: anil529
3 Replies

2. UNIX for Advanced & Expert Users

Script run by cron gives no output

Hi All, I have a script which checks the status of HP Smart Array & then emails me the output. The script run fine when executed manually but I receive no output when configured in a cron job. The script is below: hpacucli ctrl slot=3 show config | mail -s "ARRAY STATUS-`date`"... (6 Replies)
Discussion started by: coolatt
6 Replies

3. Shell Programming and Scripting

Need help to run a script on cron

I need someone to help me out to upload script on host but I have problem can anyone help me out ? (2 Replies)
Discussion started by: spit
2 Replies

4. UNIX for Dummies Questions & Answers

logrotate and cron.daily/weekly

Hi guys, I've got two separate logrotates I'd like to run, one for Tomcat and one for Apache, but I'd like to run the Tomcat one daily and the Apache one weekly. Now, the logrotate itself is working fine, but although I have 'daily' in Tomcat, and 'weekly' in the Apache one, the latter is... (2 Replies)
Discussion started by: jimbob01
2 Replies

5. HP-UX

script in cron didnt run

Hi, I have script in the cron which run at predefined time everyday. If the script fails then we get the mail and a log is created. But last night the script didnt run. If the script is even started it creates log so it seems the script never ran. It has never happened before. Th... (5 Replies)
Discussion started by: shipra_31
5 Replies

6. UNIX for Dummies Questions & Answers

Run a .sh script daily

Hi, I juat wondering how can you set it up so that .sh files will execute automatically once a day. from google I've got use crontab but when I type this into my session it say I am not allowed to use this programme. Any other ways to achieve what I'm looking for? thanks (1 Reply)
Discussion started by: blackieconnors
1 Replies

7. Shell Programming and Scripting

how to run script? call other script? su to another user? make a cron?

Good morning. I am searching for "how-to"'s for some particular questions: 1. How to write a script in HP-UX 11. 2. How to schedule a script. 3. How to "call" scripts from the original script. 4. How to su to another user from within a script. This is the basics of what the... (15 Replies)
Discussion started by: instant000
15 Replies

8. UNIX for Dummies Questions & Answers

Help Creating Daily Cron Job

I need to create a cron job that will run daily to change permissions to a particular folder to 666 every 24hrs. I have no experience with crontab or cron jobs at all so if someone can guide me through this it would be a great help. The folder's example is 'www/test/htdocs' Also if you... (3 Replies)
Discussion started by: Xechno
3 Replies

9. UNIX for Dummies Questions & Answers

cron.daily

At what time does cron.daily implement and how can i change this or set it etc? Thanks in advance. (5 Replies)
Discussion started by: ITFcraig
5 Replies

10. Shell Programming and Scripting

Help with script - run by cron

Hello, I have a shell script that runs every minute to process incoming files delivered externally via SFTP to a directory. Basically the script works and processes the files however I get an error when a new file is delivered into the directory. Please see my script below. A new file is... (2 Replies)
Discussion started by: richo king
2 Replies
Login or Register to Ask a Question
ATD(8)							      System Manager's Manual							    ATD(8)

NAME
atd - run jobs queued for later execution SYNOPSIS
atd [-l load_avg] [-b batch_interval] [-d] [-f] [-s] DESCRIPTION
atd runs jobs queued by at(1). OPTIONS
-l Specifies a limiting load factor, over which batch jobs should not be run, instead of the compile-time choice of 1.5. For an SMP system with n CPUs, you will probably want to set this higher than n-1. -b Specify the minimum interval in seconds between the start of two batch jobs (60 default). -d Debug; print error messages to standard error instead of using syslog(3). This option also implies -f. -f Run atd in the foreground. -s Process the at/batch queue only once. This is primarily of use for compatibility with old versions of at; atd -s is equivalent to the old atrun command. A script invoking atd -s is installed as /usr/sbin/atrun for backward compatibility. WARNING
atd won't work if its spool directory is mounted via NFS even if no_root_squash is set. FILES
/var/spool/cron/atjobs The directory for storing jobs; this should be mode 700, owner daemon. /var/spool/cron/atspool The directory for storing output; this should be mode 700, owner daemon. /etc/at.allow, /etc/at.deny determine who can use the at system. SEE ALSO
at(1), atrun(1), cron(8), crontab(1), syslog(3), at.deny(5), at.allow(5). BUGS
The functionality of atd should be merged into cron(8). 2009-11-14 ATD(8)