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

learn more… | top users | synonyms (1)

-2
votes
1answer
11 views

Executing MySql stored proc in Crontab [on hold]

I have a MySQL stored proc named "item" and I want Cron to run it for me - in server of course. I'm avoiding using MySQL events to unify all my 'jobs' - backup,etc. Any how this is what I did in my ...
1
vote
0answers
23 views

Getting Busybox Cron to work on Qemu ARM VM [on hold]

I created a .sh script, then tried crontab -e and entered * * * * * /etc/cronscript.sh, then tried to start it by typing crond. It looks like its trying to do something once per minute, but not my ...
1
vote
2answers
56 views

Crontab not running a shell script

Using account alex, I created: ~/pocketmine/pocketmine.sh When I manually run this using the same account, alex: cd pocketmine ./pocketmine.sh start It runs fine. I have added this to ...
1
vote
3answers
10k views

How can I check if my cronjob is runnning on my server via PHP?

I would like to give out a warning If cron is not running or if a certain cronjob is not set in crontab on my server. Is this possible to check with php?
0
votes
1answer
25 views

$PATH variable for CRON in OpenSuse

I have a script written which works perfect on terminal however gives error when called through crontab. It took me a while that the problem is with the cron environment not my script. so I tried ...
0
votes
0answers
21 views

forever stop not working in shell script [on hold]

I have a server in node.js that I must restart every 1 hour. So I created a server.sh file and put this: forever stopall forever start /var/www/server/server.js I tried this as well forever stop ...
7
votes
3answers
11k views

How to add unique id to file name in cron job?

My cronjob looks like this: 5 3 * * * mysqldump -u root test > /srv/backup/mysql_daily.dump How can I make filename unique for every time when cronjob writes mysql_daily.dump?
2
votes
1answer
13 views

Can I move 0yum-cron from cron.daily to montly?

I installed the yum-cron package, configured too only check for updates and then mail me. But, doing this daily, seems a bit too much. I would like to do this monthly. The file is located in ...
1
vote
1answer
25 views

Cron Job Hourly Except Certain Time Frame on Friday

I want my cron job to run every hour, every day except Friday when I don't want it to run at all between the hours of 2am-9am (but hourly outside of this timeframe). Ideally, I'd like to have this in ...
1
vote
0answers
11 views

Crontab -e @reboot script doesn't start on restart

I add a string to crontab -e @reboot /home/user/start-ethminer.sh > /home/user/start-ethminer.log 2>&1 My /home/user/start-ethminer.sh file has the following content: #!/bin/sh screen -m ...
1
vote
1answer
43 views

script Multiple Commands

I have a PHP script I'm running from Cron. I want to save its output to file, but also want to save the shell output to a different file. Ideally, I'd like to have this in one line. As such, I tried ...
0
votes
0answers
15 views

Setting anacron on mac

I set cron to run script every day using env EDITOR=nano crontab -e where I wrote something like this @daily path/to/sript.script Now I want to use anacron to be sure that script is going to be run ...
0
votes
1answer
18 views

Crontab and screen at reboot

I try to create a cron command that execute a software in a screen during start-up on my Debian. It seems easy by doing this command but it doesn't work (no screen created during start-up): ...
2
votes
1answer
27 views

User cron jobs are not being executed any more (perhaps SELinux)

I have the following output as a user running crontab -l: #Ansible: backup-external chaos */20 * * * * flock --nonblock /home/mu/.cache/backup-external.lock backup-external chaos */20 * * * * ...
0
votes
0answers
38 views

Pg_dump does not work in Cron

I have the command below and run it succesfully: /usr/lib/postgresql/9.1/bin/pg_dump -U dspace --format=c --file=/dspacebkp/dspace_db_$(/bin/date +\%m\%d\%Y)_uncompressed dspace I can see my new ...
2
votes
0answers
56 views

use find command in bash file

I am using this script in my Linux machine to find all files that were modified yesterday: #!/bin/bash find /home/*/domains/*/public_html/ -name "*.php" -mtime -1 | while read line; do echo "$line" ...
5
votes
4answers
1k views

A gzip process regularly runs on my system, how do I figure out what is triggering it?

For a while now, I have had the problem that a gzip process randomly starts on my Kubuntu system, uses up quite a bit of resources and causes my notebook fan to go crazy. The process shows up as gzip ...
3
votes
2answers
1k views

Do spaces matter in a crontab

It's not clear to be from the manpage for crontab. IS extra white space allowed between the fields? e.g., if I have this: 1 7 * * * /scripts/foo 5 17 * * 6 /script/bar 31 6 * * 0 /scripts/bofh is ...
-1
votes
2answers
26 views

Script not running! Also how to attach timestamp in mail?

I have the following bash script... #!/bin/bash # Delete JUNK temp folder if [ -d JUNK/FOLDER/PATH ] then rm -rf JUNK/FOLDER/PATH echo "Cleansed JUNK directory successfully!" /usr/bin/mail -s ...
2
votes
1answer
8k 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 ...
0
votes
2answers
30 views

broken cron job after editing it

I'm having some difficulties on understanding why the following cronjob does not work anymore: 30 3 * * * /path/to/backup_script.sh && tar -czvf ...
0
votes
4answers
183 views

crontab not running for Fedora 23

UPDATE 2 This is a documented issue in Fedora 23. I used the workaround listed here https://bugzilla.redhat.com/show_bug.cgi?id=1263328. It looks like it is working. UPDATE I set selinux to ...
1
vote
1answer
26 views

Is it possible to have cron restart itself each day?

The reason I'm asking is under certain conditions I would like to change the email addresses that cron sends email to. For example I have database of who is on vacation so I would like to remove ...
11
votes
2answers
2k views

Suppress output unless non-zero exit code

What's the best way to suppress output (stdout and stderr) unless the program exits with a non-zero code? I'm thinking: quiet_success() { file=$(mktemp) if ! ( "$@" > "$file" 2>&1 ); ...
0
votes
2answers
21 views

How to set the path for one cron command

I had programmed a cronjob to restart a service with an apparent memory leak weekly and got an email saying that the killproc command wasn't found. That's in /sbin/killproc and I don't want to ...
0
votes
0answers
39 views

Cronjob python script

I have a python script that parses some html and then writes it to output file. I want that cronjob would execute that python script. When I run this script from command line it works fine (python ...
3
votes
2answers
23 views

Control character handling in cron/mailx

I have a cron job which runs a long script producing lots of output. Some of the output is lines delimited by single carriage returns; when run from the command line, these make the successive lines ...
-1
votes
2answers
40 views

How to start cron in Linux Mint 17.3

How can I start cron at startup of computer, so I can use a cronjob to automatically make a backup using rsync. I am not well known with how to start programs in Linux. I am using Linux Mint 17.3.
11
votes
3answers
23k views

Manually run a cron job / simulate running cron job?

I am new to cron and I want to test if cron's mailing stuff after an executed task and things like that work. Is there a more elegant way to test this, then setting a cron job to run every few ...
4
votes
3answers
746 views

Is it possible to have a cron job run more frequently than once every minute?

CentOS 6 I have a shell script that performs a task every minute. The task itself only takes a couple seconds to complete and ideally I'd like to have this shell script execute 2-3 times per ...
3
votes
2answers
846 views

Use /etc/aliases for outgoing mail relayed by postfix with local domain

I'm using Ubuntu 12.04 with postfix configured as satellite system that relays outgoing mail to Gmail. For sake of example, my registered domain is example.com I want root cronjobs' error output to be ...
0
votes
1answer
27 views

Need some assistance with anacron in Ubuntu

I've got Ubuntu 14.04 I try to learn about using anacron. And there're 3 things so far that I can't understand. Please explain! WHEN is the anacron command (tast) executed for the FIRST TIME? Let's ...
0
votes
1answer
29 views

Deleting a file after X days does not work [duplicate]

Ive tried multiple ways of writing this and im executing the script myself so it isnt the crontab that isnt working. These are examples of what ive tried : find /home/backups -mtime +1 -exec rm {} \; ...
0
votes
2answers
22 views

which programs benefit the most by cron (for a SOHO user)?

I understand that cron is basically a job scheduler. Apart from doing $sudo apt update which I like/love to run manually as it's uncertain when my bandwidth will be free for running the update, I ...
0
votes
1answer
1k 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
0answers
46 views

Centos7 crontab @reboot sleep not working

I am currently trying to get my server to relaunch a few things on server reboot but they were failing due to screen not yet being loaded (I believe), in an attempt to fix this I added a 3min sleep to ...
1
vote
2answers
55 views

Is it evil to link to a crontab?

I think about doing something like: sudo ln -s ~/myCustomCrontab /var/spool/cron/crontabs/username because I'd like to have all customized files in my home directory. Possible risks I can think of ...
36
votes
3answers
15k views

How can I execute `date` inside of a cron tab job?

I want to create a log file for a cron script that has the current hour in the log file name. This is the command I tried to use: 0 * * * * echo hello >> ~/cron-logs/hourly/test`date "+%d"`.log ...
0
votes
1answer
21 views

How to update crontab for a user with a script without duplicating comments

So I've noticed that I've dumped a lot of annoying comments in the top of quite a few crontab files by using crontab -u user -l > /tmp/crontab.user #muck with the file crontab -u user ...
2
votes
1answer
94 views

How to run a script in a screen on reboot

I want to start a blocking server in a screen on reboot, so that I may access it later. The command screen -d -m /home/dataserv/www/start_production_server.sh works on its own just fine regardless ...
0
votes
1answer
37 views

Why doesn't `date +%F_%T` work in crontab? [duplicate]

When I use time and date at the end of a crontab line like backup`date +%F_%T`.sql or like backup`date%d%m%y`.sql, my crontab command doesn't work. But when I remove it, it works perfectly. Why ...
0
votes
1answer
18 views

Linux Mint 17.2 encounters an error, remounts disk in readonly

I already posted the question actually (Linux Mint 17.2 suddenly loses write access to filesystem), but since it occurs rarely I need to ask again with some new info I gathered. I suspect that this ...
0
votes
0answers
31 views

ubuntu Crontab not running properly

I have to run crontab in xvfb display mode forever when the system restarts...below is crontab code.... @reboot nohup Xvfb :1 -screen 0 1024x768x24 & export DISPLAY=":1" @reboot /usr/bin/forever ...
4
votes
3answers
201 views

How do I format these two complex cron statements?

I need two very specific cron statements: A cron entry that would run on the 2nd Monday of each month every 4 hours beginning at 02:00 and execute the file /opt/bin/cleanup.sh A cron entry that ...
2
votes
1answer
41 views

Access to user's session D-bus from their cron commands

What is needed to give cron commands access to the session bus (if it is running)? It used to work for me, on Debian Stretch (testing) since switching systemd until relatively recently (might have ...
0
votes
1answer
30 views

setuid.today date format changed after FreeBSD 10.2 update

My setuid.today has a different date format than setuid.yesterday: setuid.today (German localization?) 3 Dez setuid.yesterday Dec 3 I'm getting emails with the diff reports every day. I guess ...
1
vote
1answer
74 views

Boot computer on schedule 2 times per weekday [duplicate]

My setup: I use Ubuntu 14.04 to perform a range of tasks. These tasks are performed whenever I execute a bash script. When it has finished the tasks the computer is automatically shut down (I don't ...
0
votes
0answers
19 views

dstat not installed with cron

I have an auto install bash script triggered by cron, when some condition is met, the install process is triggered. It essentially looks like this: #!/bin/bash if [[ -f "/usr/bin/apt-get" ]]; then ...
1
vote
3answers
36 views

script not running as expected when scheduled as a cronjob

I'm trying to write a script that will identify corrupt jpg images using imagemagicks identify command. The script will run the command, grep the output for the word "Corrupt", move it to a corrupt ...
0
votes
0answers
57 views

Issues with a cron script

I have a shell script which does following: Do a scan on websites (URLS coming from all_hosts.txt), Get json reponse which is saved in file (outputscanner.txt) Run a json parser (jq) on above file ...