Need cronjob to kick at a specific time


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Need cronjob to kick at a specific time
# 1  
Old 07-25-2013
Lightbulb Need cronjob to kick at a specific time

Hi,

I need to schedule a cronjob to kick start @ 8:30 PM server time and run every 5 mins there upon till I force stop it.

Can you please let me know how can it be achieved ?
# 2  
Old 07-25-2013
Code:
# minute (0-59),
# |      hour (0-23),
# |      |       day of the month (1-31),
# |      |       |       month of the year (1-12),
# |      |       |       |       day of the week (0-6 with 0=Sunday).
# |      |       |       |       |       commands

i often use the above self explainatory comments at the very beginning of my crontab file.

For your case, If you specify */5 in the 1st field, it runs every 5 minutes .
Code:
*/5 * * * * /home/scripts/backup.sh

# 3  
Old 07-25-2013
Lightbulb

Quote:
Originally Posted by codemaniac
Code:
# minute (0-59),
# |      hour (0-23),
# |      |       day of the month (1-31),
# |      |       |       month of the year (1-12),
# |      |       |       |       day of the week (0-6 with 0=Sunday).
# |      |       |       |       |       commands

i often use the above self explainatory comments at the very beginning of my crontab file.

For your case, If you specify */5 in the 1st field, it runs every 5 minutes .
Code:
*/5 * * * * /home/scripts/backup.sh

Thank you for your reply, but I am not sure how to code start[trigger] time of the cronjob to 8:30 P.M in there. Can you please suggest ?

Last edited by mohtashims; 07-25-2013 at 03:34 AM..
# 4  
Old 07-25-2013
Quote:
Originally Posted by mohtashims
Thank you for your reply, but I am not sure how to code start time of the cronjob to 8:30 P.M in there. Can you please suggest ?
Do you want your command/script to run only @8:30 pm once daily?
# 5  
Old 07-25-2013
Yes Daily @8:30 PM. Can you provide the crontab entries ?
# 6  
Old 07-25-2013
Quote:
Originally Posted by mohtashims
Yes Daily @8:30 PM. Can you provide the crontab entries ?
okay, the below cron entry will get file once daily at 8:30 pm.

Code:
30 20 * * * /home/test/scripts/example.sh

This User Gave Thanks to codemaniac For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crontab does not kick at the given time

I have crontab set to be triggered daily @ 8 am and 8:20 am server time. 00 08 * * * /web/scripts/check.sh 20 08 * * * /web/scripts/check.shuname -a Linux mymac 3.10.0-327.36.3.el7.x86_64 #1 SMP Thu Oct 20 04:56:07 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux ls -ltr /web/scripts/check.sh... (9 Replies)
Discussion started by: mohtashims
9 Replies

2. Red Hat

Need Kick Start Post and Preinstallation Scripts

Hi All Rhel Admin Need a Small Help please Give me a Preinstallation Script and postinstallation script for Kickstart Preinstallation script Just Need to Partition 1 TB HDD using LVM Except Boot /boot = 500 swap = 16 GB / = 850 Gb 8e And need to format it in ext4 ... (1 Reply)
Discussion started by: babinlonston
1 Replies

3. UNIX for Dummies Questions & Answers

Script does not run from a user specific cronjob.

Hello, I have two crontabs, one for the root and one for another user. There is a script in my configurations that has to send a email. The script works and sends the emails when I run it by hand with either the root or the user, and when I program it in the root's crontab. But! It does not... (3 Replies)
Discussion started by: Tralaraloro
3 Replies

4. Red Hat

how to re-create kick start bootable ISO

Hi All, I want to create kick start bootable ISO file. I have Centos 5.4 ISO and customized ks.cfg file. Now I need to recreate ISO with ks.cfg and content of existing ISO. During installation, it automatically should pick the kick start file and need to proceed with the installation. ... (0 Replies)
Discussion started by: kalpeer
0 Replies

5. Shell Programming and Scripting

Error at the time of cronjob run

Hi All , Please read the below data carefully. I have run the below script on unix server its running succesfully. but when i run the same script using cronsetyp it giving me the error : command not found at (line num):cruiseStartup.sh below is code netstat -anp |grep 8181... (5 Replies)
Discussion started by: aish11
5 Replies

6. 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

7. Shell Programming and Scripting

Cronjob for recognizing changes and/or new files in specific directory

Hey Guys, is there a way to create a cronjob to watch over all changes in a specific directory, for example /home/user and send them, if there are any changes, to a server:confused: Thanks Sebi0815 (4 Replies)
Discussion started by: Sebi0815
4 Replies

8. Shell Programming and Scripting

Help with kick user in network script.

Hello ! I am new at this and could use som help with at script i want to do. I have a ubuntu server and want a script that check how long time a user has been login. If a user in the network has been login more the 10min i want the user get the messege " You have been login to long". An after... (1 Reply)
Discussion started by: smurfen
1 Replies

9. Shell Programming and Scripting

need a little kick with sed, got it almost but on glitch

hi friends. yo i have a textfile with urlīs in it sometimes middle in text, sometimes one url alone is a line i append a string right behind the domain name so that http://unix.com becomes http://unix.com.APPENDTHIS on all occasions. i use this sed-line to achieve this: sed -i... (3 Replies)
Discussion started by: scarfake
3 Replies

10. UNIX for Advanced & Expert Users

Kick off Application on PC from Sun

I need to kick off an application on windows from my sun workstation. The workstation needs to know when windows application completes the job. What are the possible ways of doing it. Any ideas on how to go about doing it will be very helpful. Thxs in advance. (9 Replies)
Discussion started by: vbshuru
9 Replies
Login or Register to Ask a Question