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
DWWW-REFRESH-CACHE(8)						      Debian						     DWWW-REFRESH-CACHE(8)

NAME
dwww-refresh-cache - rebuilds dwww cache directory SYNOPSIS
dwww-refresh-cache DESCRIPTION
dwww-refresh-cache is a simple shell script, which deletes outdated cache files and rebuilds contents of the dwww cache directory /var/cache/dwww. In default installation, the script is called from /etc/cron.daily/dwww, so the cache is refreshed every day. CONFIGURATION VARIABLES
DWWW_KEEPDAYS Specifies, how many days documents that have not been accessed should be kept in the cache. Default is 10 days. DWWW_QUICKFIND_DB Location of the installed packages and programs cache file, generated with help of dwww-quickfind(8). Default is /var/cache/dwww/quickfind.dat. DWWW_DOCBASE2PKG_DB Location of the cache file, which maps installed doc-base files to packages names, used by the dwww-build-menu(8). Default is /var/cache/dwww/docbase2pkg.dat. FILES
/etc/dwww/dwww.conf Configuration file for dwww(7). /var/cache/dwww dwww cache directory. /etc/cron.daily/dwww. dwww daily cron job SEE ALSO
dwww(7), dwww-build-menu(8), dwww-cache(8), dwww-find(8). AUTHOR
Robert Luberda. See dwww(7), for copyrights and stuff. dwww 1.11.1 February 15th, 2009 DWWW-REFRESH-CACHE(8)