Cron is a job scheduler that allows users to run commands periodically.

learn more… | top users | synonyms (1)

1
vote
1answer
15 views

Why can I not source a file with the default cron installed on a debian wheezy server?

I use cron for years now. In order to load all my environment variables at once (often but not always .bashrc), I define them in a dedicated file that I source in the crontab: * * * * * (. ...
0
votes
1answer
31 views

How do I do “Hello World” to try using cron

I am using Fedora 20, and want, eventually, to set up automatic backups. I managed a trial run on my previous Fedora 12 installation, but can't get started again. I am using zshell. I thought I would ...
0
votes
1answer
13 views

Why is there an apt-get script set in my cron.daily, I'm on Fedora 20?

I found this file tonight: /etc/cron.daily/apt.cron #!/bin/sh [ ! -f /var/lock/subsys/apt ] && exit 0 [ -f /etc/sysconfig/apt ] && . /etc/sysconfig/apt [ $CHECK_ONLY == "yes" ] ...
2
votes
2answers
51 views

How to make my bash script be able to create an log file for a clamscan running in cron?

I've created an custom clamscan(clamav) in bash and when I run it in my shell everyhing is fine, but if I run it in a cron, it can't create the log file. This are the errors: ...
0
votes
1answer
37 views

CRON job to check if PHP script is running

I am having trouble regarding CRON jobs, I've basically got two php scripts that I want to keep running continuously on my server. Currently I am using an infinte loop to keep them going but they seem ...
0
votes
1answer
34 views

openSuse, not running the cron job

I have created a cron job in the /etc/cron.d/dispatchingEmail_I the permissions of dispatchingEmail_I are the following: -rw-r--r-- 1 root root 84 Sep 11 19:52 dispatchingEmail_I content of ...
0
votes
1answer
15 views

Unable to install crontab on OpenSuse

I am running the following command as root, on OpenSuse: linux-gn77-PC:/home/harbir/project # crontab -e when the editor opens up I type the following, as I want the command to be run at 2145 hours ...
1
vote
3answers
47 views

Using nohup to keep a script running indefinitely

I am very new to Linux and I've only been using it to SSH to my web server using Putty. The issue I am having is this: Basically I've got 2 php scripts. One get_tweets.php constantly listens for ...
2
votes
1answer
16 views

Incorrect cron for midnight?

I checked the crontab set by the hosting company and they have this: 0 * * * * /usr/bin/php /www/sites/[domain.com]/files/html/shell/indexer.php reindexall Does this cron run constantly or once at ...
1
vote
1answer
24 views

Execute All Cronjobs in ~/.zshenv Environment

I want to execute all cronjobs in the environment defined in my ~/.zshenv, and I want to redirect STDOUT and STDERR of every cronjob to a single log file. I am on OS X 10.9. What is the cleanest way ...
2
votes
1answer
25 views

Qt program not invoked by cron

I had a simple Qt program, when running, it shows a simple window with a countdown timer. If you might be interested in the code, please see here. I had crontab line * * * * * ...
0
votes
1answer
25 views

How to create CronJob for running commands on reboot?

Via my host I have SSH access and a control panel. I installed Rails via SSH on a light weight server. I want to reboot the server when it goes down. I think I need to start it manually since I want ...
2
votes
1answer
15 views

Send cron mails to root bundled every hour

Sometimes when there's a problem on my server, I get hundreds of emails in my root account which are caused by cron. I want to be notified about those problems but isn't there a way to bundle those ...
1
vote
1answer
40 views

How can I periodically check if my network is up and reconnect if not?

I've written a script to periodically check whether my network is up by pinging three major sites and disconnecting and then reconnecting my network if all three fail. This script works fine from the ...
0
votes
1answer
44 views

Run screen command with variable & tick through cron (cron run .sh)

I run screen command through cron, where the codes is in lorem.sh files. This is cron codes: * * * * * cd /home/z; ./lorem.sh Inside lorem.sh: screen -S screenname -X stuff $'\033[B' sleep 1 ...
0
votes
1answer
47 views

crontab entry for a command to run every week and three months?

What would be my crontab entry for a command which I want to run every week. I don't want to run any command between 8 PM till 5 AM and any random day is fine. Similarly what would be my crontab ...
1
vote
2answers
74 views

Can I configure error notifications on a specific cronjob entry to go to a different email address?

I have multiple cron job entries configured under a single account: 0 0 * * * /foo/foo.sh 0 2 * * * /foo/foo2.sh 0 4 * * * /foo/foo3.sh Right now, if any of these encounter an error, an email is ...
0
votes
0answers
17 views

How to prevent cron emailing on termination

Whenever one of my cron scripts finishes, I get an email saying /bin/bash: line 1: 19653 Terminated <command>. How do I prevent this email being sent? I suspect it might only happen when the ...
2
votes
1answer
52 views

How can I pass a filename containing percent signs (%) as a parameter to a shell script in cron? [duplicate]

We have currently setup a cron job for our new script as below: 46 22 * * * /gzm_common/diagbat9/global/prod/chgstatus.sh /backups/diagbat9/Demantra/output/SK_ITEM_EXTRACT_MFGPRO_$(date +%m%d%y).txt ...
0
votes
2answers
30 views

confuse about User:Group what is the best for /var/www, and Crontab user?

I'm new on linux server. I have 2 question that I'm confuse about this. 1 1. user:group now I chown my /var/www/html like this. my nginx.conf is set server{ user www-data } and in terminal I set ...
0
votes
2answers
50 views

How to set cron job for system

I'm really new on Linux and have no any previous experience on it. And I opened this account to ask this question. I need to install a cron job I've followed the short guide here. Well, I think it ...
1
vote
1answer
116 views

Reboot when no network connection does not work!

I have a Raspberry Pi that I use as a NAS for my local network. It works fine, but when I turn off the router to which the pi is connected, it permanently loses the connection. To be able to connect ...
1
vote
2answers
306 views

crontab error with (No MTA installed) but I use >/dev/null 2>&1

I'm new on linux user I try to run crontab to backup my database with vagrant user * * * * * /usr/bin/mysqldump -h localhost -u root -p root mydb | gzip > /var/backup/all/database_`date ...
1
vote
0answers
39 views

systemctl to start cron-like job

In /etc/systemd/system directory I have: rsnapshot-backup.service file, with following content: [Unit] Description=rsnapshot backup automation [cron like] [Service] Nice=19 IOSchedulingClass=2 ...
0
votes
1answer
47 views

How to start a cron task?

It sounds really simple, but many times I was stuck at the beginning of learning a new command. The tutorial writer think it's natural to start, but it's not. This is the tutorial I've been reading: ...
0
votes
1answer
45 views

What should be the security context of these cron files?

I am running Fedora 20 and I am having some issues when running logrotate and anacron which I suspect may be related to SELinux: Failed to determine timestamp: Cannot assign requested address chgrp: ...
15
votes
3answers
943 views

How can I start a cronjob 1 hour later each day?

I need to start a cronjob every day, but an hour later each day. What I have so far works for the most part, except for 1 day of the year: 0 0 * * * sleep $((3600 * (10#$(date +\%j) \% 24))) ...
0
votes
1answer
46 views

Restarting process via cron every 12 hours

I'm not familiar with cron at all, and I've looked it up and am still confused as to how specifically it works. I'm on CentOS 6.5, and I need to end a process and then start it again every 12 hours. ...
0
votes
1answer
171 views

how to set crontab PATH variable

I had a problem running a script from crontab. After some research I understood the problem was because PATH parameter doesn't include /sbin. I looked what it does include in /etc/crontab: ...
1
vote
1answer
68 views

Cannot edit crontab as non root user

When I use the command crontab -e on my Debian server as a non root user (in this case as postgres), I can't edit it because of "/tmp/crontab.SJlY0Y/crontab" [Permission Denied] crontab -l on the ...
0
votes
2answers
35 views

`cron` service and `at` command

Help to understand: is there any relation between cron and at command. Actually if I stop the cron services in SUSE by running following command: /etc/init.d/cron stop after above, if I run at ...
4
votes
2answers
42 views

Create new temporary directory

What's an effective way of creating a new /tmp directory, that behaves just like /tmp (purged on reboot, etc.), but in a different location? In my case, I want to create a ~/dev/tmp directory where I ...
0
votes
2answers
112 views

How to kill a process in shell script which is running through cron?

I have a shell script which runs in cronjob. This shell script has to kill a process which is running and start the new process again. When I run the script manually it works perfectly fine, but when ...
-2
votes
1answer
29 views

Run job at boot and on a schedule from same crontab

I have a process that I need to run on boot and periodically. I've created a file for it in /etc/cron.d/. Is there a way for me to specify that I want @reboot 0,30 * * * *?
4
votes
2answers
265 views

Schedule job at irregular intervals

It's simple enough to use cron to schedule a job to occur periodically. I'd like to have something occur less regularly -- say, run the job, then wait 2 to 12 hours before trying again. (Any ...
1
vote
0answers
28 views

How to find out why my cron didn't run? [duplicate]

This is the content of root's crontab: 0 23 * * 0-4 /usr/sbin/rtcwake -time `date --date="+16 hours" +"%s"` -m mem This is set to fire off that command every Sun-Thu at ...
1
vote
1answer
42 views

bash script not being run by cron [duplicate]

I have a very simple bash script that runs flawlessly when I do ./removeOldBackup.sh or sh /home/myusername/backup/removeOldBackup.sh but when I add it to crontab like * * * * * sh ...
4
votes
3answers
126 views

Cronjob to run script every 3 weeks on Wednesday

Is it possible to schedule a cron job that would run every three weeks on Wednesday (8AM) only? Or, if that is not possible, to run a job every 27 days or less but on Wednesday at 8AM.
1
vote
1answer
92 views

Why doesn't my supervisor daemon start on reboot?

I have added a crontab entry via crontab -e for the current user: @reboot supervisord -c /etc/supervisord.conf Yet after the reboot, supervisord demon is not running. I need to run the command ...
1
vote
2answers
54 views

How to determine the newly closed file within a continuous audit log rotation?

I am attempting to find the best way to determine when the second file (of a matching criteria) is created. The context is an audit log rotation. Given a directory where audit logs are created every ...
3
votes
2answers
60 views

How to make Cron run

I am trying to set up cron to run the mysqlauditgrep command (its the MySQL 5.6 Utilities package). The mysqlauditgrep command is in bash. The command I am looking to run is: mysqlauditgrep ...
1
vote
1answer
57 views

How to set up Cron to run mysqlauditgrep command for 11AM on Friday

I am trying to set up cron to run the mysqlauditgrep command (its the MySQL 5.6 Utilities package). The mysqlauditgrep command is in bash. The command I am looking to run is: mysqlauditgrep ...
1
vote
1answer
128 views

Logrotate does not work for httpd service [closed]

We have logrotate working for several Centos servers. One new server has a slightly different setup, and for some reason logrotate does not work for the httpd service. When I start it manually, it ...
0
votes
2answers
99 views

Unix 11i v2 Script to detect new files within directory

I was hoping someone can point me in the right direction. I would like to create a script to check for new files (files with today's date) within a directory and then print the results to a text file. ...
1
vote
0answers
111 views

Permission denied when running logrotate with anacron

I am trying to figure out what is causing anacron to send me the following error message: /etc/cron.daily/logrotate: /var/log/mariadb/mariadb.log-20140710.gz: Permission denied error: error running ...
3
votes
1answer
131 views

sudo source: command not found

I want to run this program as root. It activates a virtual environment and runs a python program in that virtual environment. The program looks like this $cat myfile.sh source ...
1
vote
1answer
71 views

Why isn't this crontab job running

I have a cron job that runs every minute on an Ubuntu 12.04 box $sudo crontab -e * * * * * mylogin /pathto/file.sh > /log/filelog If I run file.sh, the bash script does some stuff and echos out ...
4
votes
1answer
54 views

Is it possible to put arithmetic expressions in a crontab?

I know I can do simple arithmetic in shell scripts, like so: #!/bin/bash ((sum = 1 + 2)) echo sum This will output 3 on execution. My question now is, can this kind of expressions be used in ...
-2
votes
1answer
58 views

How to send a message in Minecraft before rebooting the server? [duplicate]

I have a Ubuntu Linux Server 14.04 LTS which is running a Minecraft server. I want it to reboot every 6 hours. I have that now and after the reboot, it starts the Minecraft server. Now what I want. I ...
0
votes
1answer
55 views

Autodelete old files

I've many shares on my samba server with recycle bin module activated. When deleting remote files from Windows I see .Trash directory. I'd like to automatically remove older files, i.e. 30 days or ...