Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cron]

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

0
votes
2answers
19 views

How to limit the email output from a Cron Job

I have setup a cron job from cpanel to email me daily so I know the site files have been backed up. However, it emails the entire file paths and the whole job. Snippet of the email output I receive; ...
0
votes
0answers
17 views

the command don't run in crontab [duplicate]

hi I have problem with runnig this command in crontab mysqldump --defaults-extra-file=/var/www/xxxx/backup/database/.sqlpwd dbName > /var/www/xxxx/backup/database/database-dump-"$(date '+%F').sql"...
-6
votes
1answer
32 views

How can I run a job every 2 minutes through crontab in Linux? [duplicate]

How can I run a job every 2 minutes through crontab in Linux?
-1
votes
0answers
16 views

Maximize Server Usage for run multiple cron which have same command

I have 8 GB VPS (average 20% usage). Let's say it only has 1 cron. Cron run every minute 1 cron execute 10 data 1 cron finish to execute in 1.5 minutes Because time overlapping, i implemented CRON ...
0
votes
0answers
19 views

Running a BASH script via crontab causes ecryptfs volume to unmount

On my MX-18 linux (Debian 9 Stretch based) system, whenever a script runs via cron, my Private ecryptfs volume unmounts. Confirmed, no issue running the same BASH scripts from a terminal. Tested with ...
0
votes
2answers
15 views

Overwrite file with stdoutput from cron execution

I have this cron in my crontab 00 01 * * * /srv/python/proj/acquisizione/acquisizioneAOK.sh >> /home/crontab_logs/acquisizioneAOK.out 2>&1; mailx -s "Cron output: acquisizioneAOK" ...
-1
votes
0answers
27 views

Changing wallpaper on deepin with CRON

I want to change my wallpaper every X minutes. I want to do that automatically (duh!). So for this purpose I have created a bash script that does just that. For your consideration the script: #!/...
0
votes
2answers
32 views

Replace log file without affecting “Redirection of stdin and stdout” using nohup

production.log [2019-02-11 10:18:18] GET / [2019-02-11 11:18:19] POST blavadasdasdgd ... ... <--- A lot of in between logs and other data ... [2019-02-12 11:18:20] INFO ::HTTPServer#start: pid=...
0
votes
0answers
15 views

Question regarding sudo & crontab

I just created a script that is being run as a @reboot item in crontab -e. It runs two scripts...in order. One creates ramdisks and populates them, and another runs an executable that depends on ...
1
vote
1answer
37 views

Starting batch jobs at exact time slightly before the new hour starts

I've been reading the recent blogpost "Winding down my Debian involvement" by Michael Stapelberg. Sad details aside, it's been mentioned that within Debian infrastructure batch jobs run four times a ...
0
votes
0answers
40 views

Ubuntu 16.04.5 Ruining Monitors By Never Turning Them Off

I've seen, on two occasions, where Ubuntu 16.04.5 has completely ruined laptop monitors by never turning them off. These were laptops my Uncle owned, where he left them on all the time. I'm now ...
10
votes
2answers
874 views

Why does cron require MTA for logging?

Why does cron require MTA for logging? Is there any particular advantage to this? Why can't it create a log file like most other utilities?
0
votes
0answers
25 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
0answers
7 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
32 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/...
0
votes
0answers
14 views

Crontab (Replaced) on Logs - explanation

I've noticed that one of my scripts aren't running and found that it is on last Feb 21. Checked it on the cron logs and found this one: Feb 21 16:07:21 callertag-cc01 crontab[18564]: (ctapp) REPLACE ...
0
votes
1answer
23 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
24 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
24 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
0answers
33 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
36 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
0
votes
3answers
52 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
22 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") ...
0
votes
2answers
29 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 ($...
2
votes
2answers
72 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
48 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
43 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
2answers
48 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
1answer
44 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 ...
0
votes
1answer
61 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
23 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
65 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. ...
0
votes
0answers
62 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 ...
0
votes
2answers
45 views

Crontab problem in ubuntu 1804

I'm having problem getting my crontab to work in my ubuntu server 18.04 running as a amazon ec2 instance. I have the following line in my /etc/crontab file: */15 * * * * root /bin/bash /home/...
-1
votes
1answer
21 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 ...
0
votes
1answer
34 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
70 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/...
1
vote
2answers
54 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
33 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
27 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, ...
1
vote
2answers
57 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
28 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
82 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
21 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
62 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
2answers
64 views

Local variables in Bash script to be run by Cron

I have a bash script which loops through a list of filenames in a text file, deduces a date from the filename and then calls a library script (./dropbox_uploader.sh delete [filname]) to conditionally ...
1
vote
0answers
33 views

How to automatically start Rescuetime on startup (tried crontab and rc.local)

I have installed rescuetime on debian 9. It requires the command rescuetime to be run in a terminal, this just keeps running rather than running and closing (it adds an icon into the tray at the ...
0
votes
1answer
27 views

Debian doesn't run cron after moving boot disk

I'm working on a bunch of custom scripts for Debian to run on an Odroid. My OS is on an SD card. Recently I needed to clone this SD card to another Odroid. I copied an image using Win32DiskImager on ...
0
votes
1answer
84 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 ...
1
vote
1answer
46 views

Using cron.d in Arch

Till now I organized my non-crontab cron-jobs by cron.d in Debian-LAMP environment. My cron-jobs use me to upgrade CMSs containing my web applications. Here's how I do it from the beginning: #!/bin/...