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

learn more… | top users | synonyms (1)

4
votes
3answers
804 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 minute....
0
votes
1answer
41 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
2answers
23 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 don'...
0
votes
0answers
116 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
98 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 ...
42
votes
3answers
21k 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
31 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 /tmp/...
2
votes
1answer
134 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
54 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 doesn'...
0
votes
1answer
23 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
57 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
226 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
109 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
43 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
118 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
30 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
51 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
119 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 ...
1
vote
1answer
35 views

handle large number of same log using cron or logrotate

We have an app deployed in a server, which, under some scenarios, generates some logs in the below format. process_name.hostname.common_text.log.{error/info/warning}.date.time Now, due to this ...
1
vote
2answers
43 views

Executing a cron 9 to 5 and at midnight

It's simple for the ones who understand it but for me most of the times it's a big puzzle. I want to execute a PHP script 5 minutes after each hour from 9 to 5 and i want to run it once more 5 ...
-2
votes
1answer
83 views

Jobs not working in cron, but working manually

I have gone through similar posts in this website, but none of them is matching my query. I have the below content in my crontab, but it is not working. * * * * * perl sc.pl And when i'm trying ...
1
vote
1answer
35 views

Gnome Schedule cannot run hdparm

I have set up a cron job that should execute hdparm -y /dev/sda >> /var/log/diskspindown.log 2>&1 When testing it running it via "Run selected task" it executes fine and logs /dev/...
1
vote
1answer
29 views

Run certain script periodically at boot time

Suppose the computer is being launched irregularly. And I want to run a certain script at boot time once in a month. But I can't setup a cron job as I don't know whether the machine will be booted at ...
0
votes
0answers
55 views

cron not running rsync

I'm trying to setup a rsync task using cron. The point is to sync a work folder on a linux partition and its counterpart on a windows partition on a dual-boot computer. To do that, I'm trying to ...
0
votes
1answer
34 views

No indication of attempt to run cron job

I am running the latest Sentora version on an Ubuntu 14 server. I created a cronjob which should run every five minutes but there's no indication of an attempt to run the cron job. I have tried to ...
1
vote
1answer
20 views

Correct cron format

So I wanted to execute two commands every every week at beginning of Friday 12am and Sunday night 11:59pm before it turns Monday as I want this to be turned on from friday-sunday night then again next ...
0
votes
1answer
43 views

Run minecraft from script in cronjob

I tried making this command run at 10:20pm and then the second at 10:21pm but nothing works. I tried as root and as minecraft user but nothing. How can I get it to work? 20 10 * * * screen -S classic ...
7
votes
3answers
19k views

Running a script during booting/startup; init.d vs cron @reboot

I am currently trying to understand the difference between init.d and cron @reboot for running a script at startup/booting of the system. The use of @reboot (this method was mentioned in this forum ...
2
votes
2answers
8k views

Run a GUI program at startup

I am using Ubuntu 14.04. I wrote a small script named trial. The contents of the script are as follows: #!/bin/sh SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin sh -c firefox I copied the ...
2
votes
1answer
122 views

Notify-send doesn't work at Cinnamon

I am using Linux Mint 17. I want to be informed every 50 min, at every hour for small break. Here is cron job: nazar@lelyak-desktop ~ $ crontab -l DISPLAY=:0.0 XAUTHORITY=/home/matrix/.Xauthority ...
0
votes
1answer
85 views

crontab doesn't work corectly [duplicate]

I want to make some notification to user every day at the same time: any_hour:50 And I wrote to crontab -e: 50 * * * * DISPLAY=:0 /usr/bin/notify-send -i /home/nazar/Pictures/icons/...
2
votes
1answer
60 views

How can I get at to work on OSX?

My at on Mac OS X 10.11 seems to be incapable of launching jobs. I tried: echo "date > foo" | at now Running atq afterwards shows the job queued and no file foo was created. To make sure the ...
0
votes
1answer
47 views

Why cron not outputting to file? [duplicate]

I scheduled a cron task: 0 */10 * * * aapa bash /home/aapa/scripts/es_backup.sh &>> /var/log/super/es_backup.log It is running as logged into syslog: Dec 4 08:17:01 dexter CRON[15552]: (...
0
votes
0answers
67 views

How to view processId of process running in WINE

I'm looking to run some Windows Apps on Linux using Wine. However I need a way to check they are running (and haven't crashed). On Windows I use a Powershell script to check the relevant Windows ...
0
votes
1answer
104 views

sort and uniq commands not running as expected when run though cron

Below is a part of script which gives proper output when run manually but gives incorrect output when run using cron: sort < file1.out | uniq -ic |sort -nr> file2.out When run on the command ...
0
votes
0answers
22 views

Rebooting Ubuntu if necessary

My Ubuntu needs sometimes rebooting if it has downloaded upgrades. Can I automate it like do reboot if it is required and there is no unsaved works and I'm sleeping (say for example 3 am)?
1
vote
1answer
51 views

how do i make a script to generate a gpg backup saver?

Im making a little backup script that includes the function to encrypt the backup. The script runs automaticly with a cronjob. So the password for gpg is in a File. Its just a textfile. How can i ...
0
votes
1answer
32 views

How to set Cron job that run after every three hours for indefinite period; with Logging?

I Want to run Cronjob; after every three hours from last run time for indefinite period and can check whether it ran or not Could anyone help me in getting what values to be give in this format: ...
0
votes
3answers
366 views

Crontab on Mac OSX

I have created an /etc/crontab file on a Mac OS X that runs a few simple commands. I would like to use the crontab to echo a statement in my terminal, logout from the OS (as if I was to point my mouse ...
2
votes
1answer
31 views

How to schedule task to run everyday, if I don't know when the pc will be turned on?

So, I could use the crontab command, with: 23 0 * ... but at 23:00 my laptop can be turned off, or hibernated. In that case I want a command to be executed as soon as it will be possible. How can ...
0
votes
1answer
83 views

crontab and selinux

I have Drupal 7 on RHEL 7 and it looks like SELinux blocks crontab. aureport -a showes 90. 11/27/2015 01:32:35 httpd system_u:system_r:httpd_t:s0 87 file unlink system_u:object_r:httpd_log_t:s0 ...
-1
votes
1answer
58 views

Cron does not execute my Python script [closed]

I'm trying without success to execute a Python script using cron on a Debian Jessie Raspberry Pi. I can execute the script manually, but it fails to execute with cron. Here's what crontab -l shows: ...
1
vote
1answer
153 views

Crontab and Tmux not playing well together

So I want my server to run a script which starts several tmux sessions on boot. This is my crontab: @reboot . /home/steven/.profile; /home/steven/Scripts/Start.sh And this is the content of my ...
1
vote
2answers
130 views

Not able to schedule tasks in crontab

[srinkann@sjc-ads-440 ~]$ crontab -e no crontab for srinkann - using an empty one /bin/sh: /usr/bin/vi: No such file or directory crontab: "/usr/bin/vi" exited with status 127 [srinkann@sjc-ads-440 ~]$...
0
votes
1answer
24 views

Script for backup each DB on server but omit system databases

I have read a lot of post around this topic but I didn't found the one to fit my needs. So, basically I want to make two backups: one at mid day (12 PM) and the other at midnight (12 AM) for each ...
17
votes
3answers
26k views

how can I make cron run a job right now, for testing/debugging? without changing the schedule!

I have a cron job that is scheduled to run everyday, other than changing the schedule, is there any other way to do a test run of the command right now to see if it works as intended?
1
vote
1answer
45 views

Screen creation not working on crontab

I have a problem with one of my VPSs, in the main one, the command screen -dmS SCREEN_NAME node DIRECTORY (Create a screen without joining it with the command "node DIRECTORY") works normally, in ...
5
votes
1answer
3k views

Cron job still running when deleted

On a server I inherited, there is a cron job running hourly on one of the Debian servers. It sends an email out to a non-existent email, but bounces back to my account since I listed myself as the ...
2
votes
1answer
113 views

How do I run a script every time “yum update” is run?

I'd like to run a script (let's say myScript.sh) every time a yum update or yum install command is executed. So if I run yum update someprogram then myScript.sh should be executed right after that. ...
0
votes
1answer
406 views

How to add subject line when sending email output of find using ssmtp

I got a script running (as cronjob) that will list the files in a folder before doing a Rsync job and emailing me the list. How can I add a subject line. find /path/to/folder/ -type f -size +1M -name ...