[SOLVED] How can I run a Cron job manually or how can I sure my job executed?
Linux - NewbieThis 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!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
But how can I run a Cron job manually or how can I sure my job executed?
Under the "/var/log" directory a "cron" file exist, but I can't see anything about above jobs!
Distribution: Ubuntu based stuff for the most part
Posts: 1,177
Rep:
Your echo command would display on the terminal, but that does not do anything when run from cron. You need to redirect the echo to a log file you make.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,818
Rep:
Quote:
Originally Posted by allend
Check the mail for the root user.Typically output ends up there.
Also, check the file /etc/aliases. Mail sent to root ought to be getting forwarded to a real person who'll see the "You have mail" message when you log in. It seems there's no record like
But how can I run a Cron job manually or how can I sure my job executed?
Under the "/var/log" directory a "cron" file exist, but I can't see anything about above jobs!
Thank you.
How about changing the time to 5 minutes into the future and then sit and watch for 5 minutes? Change time back after. Just a thought.
Yes, they are executable and run successfully from the command line and I used "crontab -e".
So you know it is executable, what happens when you set the time to a few minutes into the future which seems to me to be the most logical and simple way to test. Have you tried to output the echo part of the command to a file?
# cat /var/log/cron
Jan 22 00:21:41 Server crontab[2342990]: (root) BEGIN EDIT (root)
Jan 22 00:23:21 Server crontab[2342990]: (root) REPLACE (root)
Jan 22 00:23:21 Server crontab[2342990]: (root) END EDIT (root)
Jan 22 00:24:01 Server crond[468693]: (root) RELOAD (/var/spool/cron/root)
Jan 22 00:24:02 Server CROND[2343035]: (root) CMD (/usr/bin/App1 && /usr/bin/echo "App1 done")
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.