Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Search this Thread
Old 03-16-2009, 07:47 AM   #1
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Rep: Reputation: 31
How to start my cronjob manually?


I would like to know how I may start a cronjob manually?

Old 03-16-2009, 08:04 AM   #2
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Your cron job scheduled should be some script that you have written for some purpose. Why not run the script manually?
Old 03-16-2009, 09:22 AM   #3
Registered: Mar 2009
Distribution: Fedora, Slackware
Posts: 104

Rep: Reputation: 21
Run the content from the cron job's script field in a shell. If your cron job is this (a sample):
* * * * * php /home/me/my.php
then run from the command-line the 'php /home/me/my.php' part. Note: some hosted servers would replace 'php /home/me/my.php' with something like '/ramdisk/home/me/php5 /home/me/my.php' or similar - this can be misleading.


Linux Archive

Last edited by JaksoDebr; 04-02-2009 at 05:09 AM.
Old 03-16-2009, 10:40 AM   #4
Senior Member
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,223

Rep: Reputation: 232Reputation: 232Reputation: 232

The easiest <muy facil> way to start cronjob is to place your script inside the folder --make your choice of job time frequency: hourly, daily, weekly or monthly.

Then fix your time on the crontab:

# crontab -e <Enter>
{for help read manual about crontab: $ man crontab}

To find out whether your script goes according to your expectation run it manually first:

# /etc/cron.daily/your.script <Enter>

If you want to be certain if cron will run it according to crontab, test set it in current time. You will need "reload" or "restart" cron daemon for that, or you want, reboot the system. Then check if your job is running:

# ps axu

See if your job is among the processes. Sometimes you will need wait few moments before cron starts then try ps axu it again.

Goodluck. Hope it helps.

Last edited by malekmustaq; 03-16-2009 at 10:42 AM.
Old 07-10-2012, 10:56 PM   #5
LQ Newbie
Registered: Jul 2012
Location: Florida, USA
Distribution: CentOS 6.2
Posts: 1

Rep: Reputation: Disabled
Lightbulb Use SH to test your Shell Scripts.

If your Cron job is a Linux Shell Script with the ".sh" extension, you could do the following:
[root@localhost ~]# sh /etc/cron.daily/
Old 08-10-2014, 04:37 PM   #6
LQ Newbie
Registered: Aug 2014
Posts: 2

Rep: Reputation: Disabled
This works

I know this is an old post but it worked for me.
Give drupalfever a cookie.
I hated when you search and search just to find out that people post these so called fixes and they never work.

Thanks drupalfever for a real solution.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to manually add SATA driver manually when kernel boot? aixilin Linux - Kernel 6 08-15-2008 10:36 AM
service start httpd fails, manually starting with same command works jonboede Linux - General 1 02-19-2008 11:45 AM
Cups, not having to manually start printers jweber0126 Linux - Newbie 2 01-18-2007 02:29 AM
How to manually start apache web server (SUSE9.2) Mic Q Suse/Novell 4 07-10-2005 09:08 PM
How to start IPOP3D manually, not from XINETD adamrau Linux - Software 3 07-07-2003 02:16 PM

All times are GMT -5. The time now is 09:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration