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
# 1  
Old 08-12-2018
Run script no more than twice daily WITHOUT cron

Can I run a script no more than twice a day without using cron?

Maybe create a file when script is first run and check its date?
# 2  
Old 08-12-2018
Yes, you can do anything you want.

In these forums, we expect people to post their work (their code) and not just post abstract questions.

So, yes, it's possible of course. But please post your code what you have tried
when asking questions.
# 3  
Old 08-12-2018
Search these forums as well, and look at the bottom left of this page under "More UNIX and Linux Forum Topics You Might Find Helpful"
# 4  
Old 08-12-2018
Hello!

Per forum rules, and the benefit of all users, please search the forums before posting a question.

You can easily search the forums using our internal Google search engine or our advanced internal search engine. You can also search our huge UNIX and Linux database by user generated tags or search the database for unanswered questions and provide an answer.

Thank you.

The UNIX and Linux Forums
# 5  
Old 08-12-2018
Quote:
Originally Posted by Neo
Yes, you can do anything you want.

In these forums, we expect people to post their work (their code) and not just post abstract questions.

So, yes, it's possible of course. But please post your code what you have tried
when asking questions.
I posted no code because i dont know where to start. My ? Was not abstract.

My question clearly stated the problem.

I am no expert, but am always learning.

No answer to my pm to you?

------ Post updated at 10:53 AM ------

Quote:
Originally Posted by Neo
Hello!

Per forum rules, and the benefit of all users, please search the forums before posting a question.

You can easily search the forums using our internal Google search engine or our advanced internal search engine. You can also search our huge UNIX and Linux database by user generated tags or search the database for unanswered questions and provide an answer.

Thank you.

The UNIX and Linux Forums
I did so before posting.
# 6  
Old 08-12-2018
Quote:
Originally Posted by drew77
No answer to my pm to you?
The place to ask questions in the forums about how to do something in the forums is here:

https://www.unix.com/post-here-to-co...nd-moderators/

Never by PM.
# 7  
Old 08-12-2018
Quote:
Originally Posted by drew77
I posted no code because i dont know where to start. My ? Was not abstract.

My question clearly stated the problem.

Two clear answers to your clear questions:
- Yes
- One of several possibilities.



OK, joking apart - what keeps you from using the proven system component cron?
Do you know about the at command to schedule events?
A (not optimal) approach would be to calculate the time difference from (now till schedule time) in seconds and sleep that long.


Quote:
I did so before posting.

Did you?
Listen sharp time to run a command inside a script
Run a job between times else run later
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