Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
I want to run a crontab job but it isnt working. I am writing in the crontab file with crontab -e Then I am waiting time but it isnt working.
Code:
15 17 * * * ./home/admin/backup_sc
Command running on the terminal window When I try to run this command (./home/admin/backup_sc) and I see it is running but it isnt working when I write to crontab file.
you can see crontab file at below.
Why it isnt running?
Quote:
Expert@test]# crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.5348 installed on Mon Feb 1 17:13:59 2010)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
15 17 * * * ./home/admin/backup_sc
It probably is running (trying to run, to be more specific).
Crontab doesn't have a full set of environment settings (opposed to a "normal" shell). If your script relies on any environment setting, it probably won't run from cron.
Post your script so we at LQ can have a look and point you in the right direction.
"./home/admin", you're using a relative path, which is a really daft idea, and secondly you're assuming this relative position is "/" Which is never going to be the case. I *think* you just didn't want to put the . there in the first place.
"./home/admin", you're using a relative path, which is a really daft idea, and secondly you're assuming this relative position is "/" Which is never going to be the case. I *think* you just didn't want to put the . there in the first place.
Hi acid_kewpie and druuna,
We try as /sbin/backup_sc but it isnt still working.
you can see crontab details and you can see script content.
I didnt understand, why this crontab isnt working?
Code:
[Expert@test_cpng]# crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.5256 installed on Tue Feb 2 17:45:07 2010)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
20 8 * * * /sbin/backup_sc
cron will send a mail to root containing output from root's cron jobs (including STDERR messages). This will most likely help with troubleshooting the problem.
well you're not running it as root, which seems odd. Backups are system level operations, therefore should be executed at that level, via the /etc/crontab not by a user accounts crontab. Does this other user have rights to put files there?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.