Visit Our UNIX and Linux User Community


every hour and 24hour mid night cron job


 
Thread Tools Search this Thread
Top Forums Web Development every hour and 24hour mid night cron job
# 1  
Old 09-07-2009
Question every hour and 24hour mid night cron job

I have 2 pages writing in php, and i want cron job to run the first page 'every hour' and the second page every '24hours in other words mid night'. am using cPanel

i put this code on a text file

0 * * * * /home/axe/public_html/admin/viewmemstat.php 1>/dev/null 2>&1

and on the 'Command to run:' text feild, i call this up: mycron.txt

and this was the cron output i got on my mail

"mycron.txt":1: bad minute
errors in crontab file, can't install.


infact i really do not know anything about cron job this is my 1st time.
# 2  
Old 09-07-2009
I don't know anything about cPanel but the cron job should be ok. Why not add the job with crontab instead of whatever it is that cPanel is/is not doing?
# 3  
Old 09-08-2009
According to this cPanel cron tutorial, you are not setting up cron correctly.

If you follow the tutorial, you should enter all the cron time information in the cPanel gui, and the put your:

Code:
/home/axe/public_html/admin/viewmemstat.php 1>/dev/null 2>&1

command about, in the "file to run" part of the cPanel cron setup gui.
# 4  
Old 09-08-2009
Question 24hour mid night cron job

Quote:
Originally Posted by Vi-Curious
I don't know anything about cPanel but the cron job should be ok. Why not add the job with crontab instead of whatever it is that cPanel is/is not doing?
Thanks for your reply! thats really the problem i am having, i have been hearing about "crontab" i dont even know what it is, where its located, how can i locate it,

I ghues that could solve my problem, if i could locate it, and get directions on how i can place this code in there.
# 5  
Old 09-08-2009
Well, to know about cron and crontab, you can simple search this forum or use Google and search the net. Cron is basically a chronograph that executes an executable file at a specific time or times. Crontab is the table (file) that holds instructions for Cron.

Regarding cPanel, you will not find much help on cPanel here. Most people here are UNIX/Linux jockeys who prefer not to use cPanel, and instead they manage their processes from the command line (shell).

That is why I gave you a link (below) to a tutorial on this. I think if you do a bit of homework (search and read) and then review the tutorial, you will be good to go. You can post back if you have specific issues/questions after you do some background reading.
# 6  
Old 09-08-2009
Question

Quote:
Originally Posted by Neo
Well, to know about cron and crontab, you can simple search this forum or use Google and search the net. Cron is basically a chronograph that executes an executable file at a specific time or times. Crontab is the table (file) that holds instructions for Cron.

Regarding cPanel, you will not find much help on cPanel here. Most people here are UNIX/Linux jockeys who prefer not to use cPanel, and instead they manage their processes from the command line (shell).

That is why I gave you a link (below) to a tutorial on this. I think if you do a bit of homework (search and read) and then review the tutorial, you will be good to go. You can post back if you have specific issues/questions after you do some background reading.

Thanks Neo! I have done my homework as you said, Its a diffent ball game with cPanel, all i entered was the path to my file,

Its seems to be working now! but i got this message

Permission denied

what can i do?

Previous Thread | Next Thread
Test Your Knowledge in Computers #800
Difficulty: Medium
In the system with radix 13, for example, a string of digits such as 398 denotes the (decimal) number 632.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

3. Shell Programming and Scripting

To run a job for every one hour and ...

Hi, Someone please help me to run the script to maintain a Job: Which can be run for every one hour and should maintain the last two hours files only. It should delete the rest of the files in a dir. Please suggest me with the sample script. Thanks !! Reagrds, Rama (5 Replies)
Discussion started by: ramagore85
5 Replies

4. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

5. Shell Programming and Scripting

To Run a job every hour without using crontab

Hi, Can anyone help me in finding how to run a specific job every hour without using crontab. Say for example i need to run a command ps -aux in the starting of every hour.. (3 Replies)
Discussion started by: glv
3 Replies

6. Shell Programming and Scripting

CRON Job

Hi all, Pretty new to CRON but have been messing with Ubuntu for a while now Here is the situation/problem I have run into you. I currently run a very basic back procedure by executing a daily CRON job which copies all data from one directory to a USB drive & date stamps the copy:- cp... (2 Replies)
Discussion started by: 2scoops
2 Replies

7. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

8. Solaris

cron job

hi, how i woulsd be able to find that my cron job is running or not.. E.g abc (2 Replies)
Discussion started by: sam.whocares
2 Replies

9. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

10. Shell Programming and Scripting

cron job

Hi Gurus I need to add a new cronjob to a list. There are already 7-8 cronjobs when I do crontab -e. I need to add a new cronjob without disturbing the existing ones. Can you please tell me how to do that. I am not so good in vi editor as well, but I can do it with some guidance. this is urgent,... (3 Replies)
Discussion started by: ragha81
3 Replies

Featured Tech Videos