Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means ...
1
vote
2answers
56 views
How to call perl from crontab?
I can run this command fine from the SSH console of my rackservers shared hosting:
cd /home/myaccount/public_html/whatever; perl -w
-I/home/myaccount/public_html/whatever rss2txt.pl ...
1
vote
5answers
41 views
crontab schedule for every X hour
When scheduling a job every x hours, how to tell which hours will be picked?
For example, we have a cronjob set for */8 which is run at 2AM, 10AM, etc. instead of midnight, 8AM, etc.
1
vote
3answers
30 views
Crontab and rkhunter Scheduling
I've got a system with Ubuntu 12.04 which has rkhunter installed. Currently the rkhunter daily scan script is located in /etc/cron.daily/rkhunter.
Every day at 7pm EST the rkhunter script is ...
1
vote
1answer
54 views
Linux execute permissions
-rw-r--r--. 1 myusername developers 169 May 17 09:01 build.sh
Why is it I can execute the build.sh script from the command line if it does not have execute permissions but when crontab tries to ...
1
vote
2answers
49 views
Generate automated cron jobs at different hours
Greetings I'm new to cron. Is it possible to run automated cron jobs at random minutes for every hour?
the syntax should be different every day, for example:
...
1
vote
2answers
44 views
'/var/spool/cron' is not a directory, bailing out. when trying to work with crontab via PHP's shell_exec
I am creating a web application. Part of the functionality is depending on that the user can start/stop a cronjob that imports emails.
It doesn't work.
Just to make sure I'm on the right track, as ...
-5
votes
0answers
30 views
Custom cron job [closed]
I'm using Fedora Core 14 and I would like to make a cron job for a PHP script.
I need the script to run each day from monday to friday, each hour from 09:00 AM to 17:00 PM.
How can I set this?
...
0
votes
1answer
132 views
Synology cron job not working
I am not sure where to ask this question but I'll ask here first.
I've got a Synology DS211 server and I am trying to run cron jobs but it is not working.
This is the code I got in the crontab file
...
1
vote
0answers
14 views
php script ran from crontab times out if other scripts are ran at the same time [migrated]
I have a server in my room with a duo-core processor and basic internet (nothing fancy)
I'm running ubuntu 11.04 and I'm running a php script from the crontab.
0 3 * * * php back_up_to_s3.php
This ...
-3
votes
1answer
37 views
Daily Cron Job Example
I want to run a command daily on an Ubuntu Linux box @ 9:15PM. Is this the correct entry for my crontab?
15 23 * * * <<command>>
1
vote
2answers
74 views
script to remove all files in /tmp from a certain user
One of my server daemons uses a lot of space in /tmp. Because I don't want to reboot my machine when the server runs out of disk space, I need to run a CRON script that removes old temporary files.
...
1
vote
1answer
69 views
Shutdown script
I am using Ubuntu 11.10.
I would like to make a shell script that shut down computer if nobody logins for an hour.
But if somebody logins (locally or with remote SSH connection), then i don't want ...
1
vote
1answer
82 views
Rsync inconsistency between CLI and crontab
I want to use rsync to synchronise my home folder with a "backup" copy on another drive on an Ubuntu 11.10 machine. And I want it to happen every 15 minutes.
If I manually run:
rsync -ar --delete ...
2
votes
3answers
63 views
Cron doesn't execute command after % sign in it
I have the following command in cron:
5 6 * * * bash -c "tar -czf /backups/sites-server-files-rotate/sites_`date +%F`.tar.gz /backups/sites-server-files/"
But command doesn't get executed. And I ...
0
votes
1answer
30 views
solaris + run script every night one time from the crontab
I build in my Solaris machine new script
Script name: send_brd_msg.sh ( this script located under /var directory
I want to activate this script every 12:00 at night by the crontab
Please advice ...
0
votes
2answers
51 views
difference between /usr/bin/php and php in crontab
What is the difference between specifying "/usr/bin/php" and just using "php" when setting up a PHP script to run in my crontab? I would tend to just use "php" rather than the full path.
30 16 * * * ...
0
votes
4answers
113 views
Cronjob working every 5 minutes, but not at a given specific time
I have a strange problem. Using Debian 6 and crontab -e (as root),the following cronjob works just fine:
*/5 * * * * bin/sh /root/backup
but it does not work if I set it to run at a specific time:
...
3
votes
3answers
94 views
Crontab schedule in different timezones
I would like to schedule my tasks in EST but I want the actual task to run under the default system timezone.
Whats the best way of doing this?
0
votes
2answers
53 views
My CRON job won't run, any ideas?
I've installed the following CRON job using 'crontab -e' through putty on my server, but it won't run and I have no idea why.
This is the line I'm putting in and saving using 'crontab -e':
00 09-18 ...
4
votes
1answer
85 views
cron job timing
I would like to start cron job at 9:30 and then work every 5 minutes and then stop at 16:30 everday. Is this kind of scheduling possible in one or do I have to need two cron jobs?
2
votes
3answers
100 views
Escaping characters in cron
The following works as expected from the command prompt. But it does not work from cron.
mysqldumpslow <(tail -1000 `mysqladmin variables \
| grep slow_query_log_file | awk '{print $4}'`) \
...
2
votes
2answers
78 views
Crontab is failing every five minutes
One of my server (that is running Debian) is getting these error every 5 minute
CRON[28355]: (CRON) error (grandchild #28357 failed with exit status 1)
I can't figure out, where it comes from, so ...
1
vote
2answers
84 views
Nothing happening in CRON
I put in a command for crontab but nothing seems to be happening.
#vi /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of ...
1
vote
2answers
165 views
I out-clevered myself this time: Cron Emails
At some point I did something magical to redirect email from cron (on CentOS 5.6) to an external email address (me@oldaddress.com). Now I want the cron emails to go to a different address ...
0
votes
1answer
101 views
Cron, chroot, jails, and permissions
I'm trying to grasp how to run crons under chrooted users.
I'm on Ubuntu, and using ISPConfig where I can.
I created a cronjob in ISPConfig which resulted in a file /etc/cron.d/ispc_chrooted_web1 ...
0
votes
1answer
123 views
ISPconfig and running cron jobs as root
IPSConfig runs cron jobs as root. And when adding new cron jobs in ISPconfig it sets them to also be run as root and I don't see any way to change it. Is this safe?
1
vote
1answer
73 views
enabling crontab job for user CentOS 5.x?
cat /etc/cron.allow
root
neolix
john
We have added a user to run their crontab job in CentOS 5.x, still they are not able to run the job. If any thing missing from by us, Please feel free to teacher ...
1
vote
1answer
35 views
Facing issue with cron on embedded linux
I have a SAM9 based board running embedded linux using buildroot package.
I added the crond and crontab support to busybox from make menuconfig and built the rootfs and flashed it to my board.
The ...
0
votes
1answer
58 views
Where does Cron checks the time zone on Debian?
I have seen number of topics that are related to my question, but non of them answers it.
Where does Cron look-up the time zone ?
root@awesome:~# date
Fri Feb 17 14:02:02 EET 2012
root@awesome:~# ...
3
votes
4answers
209 views
Crontab to restart service
I am running a web server on an AWS EC2 micro instance. The instance has ~630MB of RAM. With time, I have several httpd processes and very little free RAM. When I restart the httpd service, I end up ...
1
vote
1answer
57 views
How to prefix logs with date and time
How to prefix all logs with date time before they are written to the log file?
Let's say I am logging unexpected errors in crontab in the following way:
python somescript.py >> /tmp/output.log ...
1
vote
3answers
123 views
Cron jobs on debian - not working
might be somewhat of a boring topic, but I was at it whole last night, cant seem to get it up and running.
root@host:~# /etc/init.d/cron status
Checking periodic command scheduler...done (running).
...
0
votes
1answer
60 views
running cron once a minute 8am-8pm
i need to run cron job once a minute 8a.m. - 8p.m.
my code is: */01 8-20 * * * user /usr/bin/php -f script.php > /dev/null
but it seems to fail..
1
vote
2answers
71 views
Cron job's spaced out in 2:15 hour time window?
I have a total of 9 cron jobs that I need to each to run once with 15 minute intervals in a 2:15 hour time window. So for example starting at midnight:
First Cycle
0:00 - Cron 1
0:15 - Cron 2
0:30 - ...
4
votes
1answer
78 views
How does cron.d notify the system?
If I put a new script into /etc/cron.d/ how does the system know to insert it into the global crontab?
Do I need to restart a process to pick it up?
Does init run crontab every minute, and it'll ...
2
votes
3answers
122 views
Run bash_profile in cron job
I had a problem that my cron script wasnt loading the environment variables so I added the following line:
#!/bin/sh
bash /root/.bash_profile
This seems to have no effect and the path variables are ...
1
vote
2answers
52 views
Cannot find crontab entry for a scheduled shell script
My predecessor set up a basic installation of CrunchBang in a VirtualBox VM - The Windows host runs a scheduled task to boot the VM, then CrunchBang runs a shell script some 10-15 minutes later to ...
0
votes
1answer
98 views
ubuntu crontab -e “/usr/bin/sensible-editor” killed; signal 9 (no core dumped)
Welcome to Ubuntu 11.04 (GNU/Linux 2.6.32-042stab037.1 x86_64)
user@server:~$ crontab -e
no crontab for user - using an empty one
Select an editor. To change later, run 'select-editor'.
1. /bin/ed
...
0
votes
1answer
115 views
cron job gives me permission denied errors when running
Been trying to run a cron but keep getting permission died error in my /var/spool/mail/root
"/bin/sh: /disk1/archives/backup.website.cron: Permission denied"
This is my ls -hal for the directory my ...
2
votes
2answers
56 views
how to setup a cron job and using the proper syntax in my jobs
I want to make a cron job that creates a tar of my web directory.
I have this job in place
* * * * * tar -zcvfp /disk1/archives/websites/`date +%Y-%m-%d_%I-%M-%S-%p`/`date ...
2
votes
2answers
66 views
egrep not working in crontab
I have a simple bash script wich works fine when running in command line, but not in crontab:
#!/bin/bash
PATH=/usr/bin:/bin
for f in /data/home/cwolff/tmp/*access_log*.txt;
do
egrep "r:[A-Z]+ ...
0
votes
3answers
64 views
crontab running as a specific user
I need to run a script daily. The script should be run as a specific user (ex. user1) not as root. So I put the cron file at /etc/cron.d and put the user name in the line (2nd column). But it gives an ...
1
vote
7answers
226 views
mysql database daily backup on ubuntu server
I use crontab -e
in ubuntu server for running a backup.sh file every night at 02:00 AM. I wrote: 00 02 * * * root /home/backup.sh
Then /etc/init.d/cron restart
When do crontab -l it shows:00 02 * * * ...
1
vote
1answer
106 views
crontab steps plus increment
I want to issue two commands, c1 and c2, both every five minutes, but not at the same time, e.g.
0,5,10,15,20,... * * * * c1
2,7,12,17,22,... * * * * c2
is there a more elegant version using an ...
0
votes
1answer
96 views
Crontab have permission issues on file of its owner? Permission denied
I have a very simple cron job written in shell script, which scp a file from another server to local.
e.g,
#!/bin/bash
scp $REMOTE:/$FILE ./
Of course, the server need a private key to login, ...
3
votes
3answers
94 views
Is there a good layout convention for cron files?
I'm currently confronted with a cron file that contains a dozen different applications' tasks--some have only one, some have lots. I'm trying to figure out a good way to organize and document these ...
0
votes
2answers
53 views
Do I need to refresh or restart anything after I add/update a crontab in Ubuntu Server 8.04?
When you change something in Apache you need to reload or restart apache. Does anything need to be refreshed or restarted in Ubuntu Server 8.04 after I add/update the crontab? Thanks a bunch for your ...
1
vote
1answer
254 views
Sending mail from command line if body not empty
I'd like to write a simple script that alerts me if a log changes. For this I'm using grep to find the lines I'm interested in. Right now it works like this:
grep line /var/log/file | mail -s Log ...
6
votes
2answers
303 views
Is it bad to edit cron file manually?
It is usually instructed to introduce new cron jobs through command lines; but I found it easier (with a better control of current cron tasks) to manually edit (in text editor) the user cron file like ...
0
votes
1answer
59 views
trac-admin hotcopy not working when run from crontab
I've recently updated Trac from 0.11.4 to 0.12.2. I'm using the following shell script to backup Trac installation:
#!/bin/sh
DIR=/root/backup/trac/
NAME=`date +%Y-%m-%d-%H-%M`
cd $DIR
trac-admin ...