Stack Exchange Network

Stack Exchange network consists of 174 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 task scheduler based on clock time that runs on Linux-based machines.

0
votes
0answers
12 views

How to run a command in tmux automatically

I have a GarrysMod server running in tmux that is started up automatically via cron on reboot, and the box restarts daily, but I need to run a command in the server an hour before the reboot to warn ...
0
votes
0answers
5 views

Plesk Scheduler: Difference between fetch url and run a php script

I don't understand which schedule option (fetch url or php script) is better to use. I have a script (genzo.php). I could use it like: Fetch url: https://www.example.com/genzo.php?cron=1 Run a php ...
0
votes
1answer
24 views

Remove Injected Script in Crontab

I have a Server installed with Ubuntu 16.4.5 LTS. When I check crontab, there is a script that download from anonymous website and run the script. I try to remove the schedule but the script ...
2
votes
1answer
27 views

Root cannot edit crontab

I need help. I'm using ubuntu 16.04.5 LTS. i wanna edit the crontab and i already login as root. when i run command "crontab -e", there is already a schedule that download file and execute. i think it'...
2
votes
0answers
12 views

What is reloading postfix twice at 4AM

Centos 7, postfix I get a daily reload of Postfix. It's happening twice, back to back. Jan 8 04:02:08 tn2 postfix/postfix-script[8927]: stopping the Postfix mail system Jan 8 04:02:08 tn2 postfix/...
0
votes
0answers
20 views

Crontab runs but doesn't execute

My crontab looks like this * * * * * /opt/PPP/update_playlists.sh >> /var/log/cron.log 2>&1 */5 * * * * /opt/duckdns/duck.sh >/dev/null 2>&1 (I set to every minute for testing ...
0
votes
1answer
23 views

Is there a downside to using flock in cron jobs?

I use several cron jobs, where they run frequently I use flock to prevent duplicate jobs running. I just thought that it seems to make sense to use flock on every job, irrespective of the frequency, ...
0
votes
1answer
28 views

Install new crontab from within vim

I edit my crontab using vim (opened via crontab -e command). How can I update the effective cron table without leaving vim? For safety reasons crontab -e opens a temporary file (check path by ...
0
votes
1answer
32 views

How to manipulate DOM in ubuntu command line without actually rendering the page on the GUI?

I've written a small JS snippet which clicks some buttons in the DOM of a certain target website in a loop. To run this snippet, I open the target website in firefox. Then I paste this JS snippet in ...
0
votes
1answer
51 views

Sending email to gmail from cron

Looking for help sending email to a gmail address from my cron. At the top of crontab MAILTO="obfuscated@gmail.com" But no mail comes. Checking /var/log/maillog, I see Dec 17 22:46:36 myserver ...
0
votes
1answer
53 views

ip does not work / does not produce output when run with cron

I have a bash script in which I use the ip r command. When I run the script in bash it works but when cron runs it it does not. This is the line in my script: ping -q -w 1 -c 1 `ip r | grep -m 1 ...
0
votes
0answers
20 views

Python boto3 profile not found when lauched from cron tab

I'm running Amazon Linux 2018.03 (which I suppose is basically CentOS) with Python 2.7. I have a python script my_script.py that uses the boto3 library to use AWS services. I want to run the script on ...
0
votes
1answer
54 views

Create a crontab script with curl

Trying to set a cronjob to use with curl. Want to update IP on noip.com. The command below gets the IP from noip.com but does not update it with my servers ip. I mean: when the IP is not updated then ...
0
votes
2answers
42 views

Logging MAC of all machines on my network

I would like to know what machines connect to my home network. My thought was to have a MySQL database with an entry for each machine, with the timestamp of when I saw it last, and a tally of how many ...
0
votes
1answer
15 views

Shell script zips a folder, but exclude parameters not working IF its run from cron.daily

The script works fine if I run it with sh filename, but it ignores all the --exclude parameters if its run by cron: #!/bin/sh TIMESTAMP=$(date +%u) WEEK=`date +"%V"` if [ $(($WEEK%2)) -eq 0 ]; then ...
1
vote
1answer
44 views

linux - send an email where body is a line of text from a file - date dependent

I would like to add a cron task that sends an email to me@example.com once a day and includes a line of text from a file depending on the date as the message body. My file.txt would look like this: ...
1
vote
0answers
92 views

Timeshift schedules not working on Fedora and Manjaro. Why?

Nowadays I am using Fedora and Manajro mostly. I use openSUSE and sometimes min Mint. I have installed TimeShift in my machine with Manjaro and a friend's machine with Fedora. In both the schedules ...
0
votes
2answers
20 views

Set up `cron` job and mailto on error, on Arch

I use postfix linked to an commercial smtp server for cron jobs to send their owners an email in case of error/warning. This is a one box Arch setup. postfix works. So does cronie. But although the ...
0
votes
0answers
45 views

Ending lftp Session - Cron Job Not Running

I need to move a file via ftps from our server to a remote server and have this run every 30mins using a cron job. The shell script I have is: #!/bin/sh # @description: Transfer inventory update ...
0
votes
2answers
44 views

Running cron jobs - best practices

I want to use cron in Linux to run backup scripts of various files in the system. The owners of these files are different users. Is it better to add entries in the cron of each user separately or run ...
0
votes
3answers
40 views

How can I execute all commands in crontab subsequently?

Consider a complicated crontab of +100 lines where a lot of scripts are run subsequently to poll & process messages from different clients. Upon reboot of the server, I trigger some scripts of ...
1
vote
2answers
437 views

How do I automate borg backup?

Background I would like to use Borg Backup as a backup solution for my Ubuntu server. They offer a very convenient sh script that they say you can just run as a cron job, but it is not working for ...
1
vote
1answer
38 views

Cron schedule from 7:15am to 8:30pm at every minute

I can't find any material on how to create hours with minute components within a single expression.
0
votes
0answers
25 views

PHP script inside cron.hourly is not working

I want to add a cron job that runs hourly and it edits information in my SQL database. addOne.php <?php $connection=new pdo('mysql:host=HOST;dbname=DATABASE','ROOT','PASS'); $prepare=$connection-...
0
votes
0answers
14 views

Unknown user starting service on Armbian

I have an Orange Pi running Armbian and I installed transmission-daemon (A Torrent Client) on it. I disabled the start up of this daemon at boot time from root user root@orangepipc:~# update-rc.d -f ...
0
votes
1answer
51 views

Pass cronjob output as parameter to curl

I have cronjob that takes hourly backup. Now I want to pass any stderr to an API. 0 * * * * /usr/local/sbin/script.sh 2>&1 | curl -k -X GET "https://192.168.0.25/path/of/joomla/instance/index....
0
votes
1answer
144 views

How to give crontab access to domain user?

I'm working on a RedHat 7.3 server and a user needs access to crontab. However this user is a domain user (ex. test@[domain]). So the user doesn't show up in the /etc/passwd file. I already tried to ...
1
vote
1answer
258 views

How to handle daylight savings in cron jobs

I have a cron job on an amazon ec2 machine (Ubuntu 16.04) that is supposed to run at 2:00 AM Central time. The cron job is scheduled using UTC time. Since Central time is currently UTC-5 (we are in ...
0
votes
2answers
150 views

rsync with cron job every minute issue

I am transferring files over the network using rsync in cron job that runs every 1 one minute, task is whenever new file come it has to start uploading on remote server: Since I am new so doing big ...
0
votes
0answers
67 views

How to improve PostgreSQL database backup script - used with crontab

There are about 15 databases to backup on a daily basis. Password is set for the postgres user. pg_dumpall is executed at the beginning of the script for a complete backup. pg_dump is ran in the same ...
1
vote
0answers
243 views

cron job not running /bin/bash: user: command not found

I'm trying to run a cron job that executes a script as a user using crontab -e on ubuntu server 16.04 LTS. The script is and located in /data/autoremove.sh: !/usr/bin/env bash if ping -q -c ...
0
votes
0answers
112 views

Bad hour error in my cron

i have an issue with my cron (bad hour error). Code of the task to drop cache is: 0 */4 * * * root sync && echo 3 >/proc/sys/vm/drop_caches && sync What is wrong with it?
2
votes
2answers
2k views

How to make WSL run services at startup

After searching this site and various Q, it is clear that services and systemd is not available for WSL. I need to run a program in WSL every time I start my PC so I read this page on how to use ...
0
votes
0answers
40 views

Managing Several Graphical Applications without Desktop Manager

I currently have a Ubuntu 16.04.4 Server install and I'm using it to launch three graphical applications. Currently the setup is to autologin in for tty1-3 and then depending on which TTY it is, to ...
0
votes
1answer
230 views

Centos 7 Allow All Users to CronTab

I'm having an issue whereby none of the users on a machine can access the crontab. It used to be possible, but it seems to have recently stopped working after a backup was restored recently. The ...
2
votes
2answers
171 views

Can't get audio from anything run via cron/crontab in Linux Mint

I am using Linux Mint 18.3 Cinnamon 64-bit (Version 3.6.6), and I can't get any audio from ANYTHING run via cron. That includes command-line audio file players, TTS apps like espeak or festival, etc. ...
0
votes
0answers
39 views

Processes started with cron are being killed sometimes

Running in a GoDaddy Shared hosting environment I have a few cron jobs. One of them ib being killed sometimes and i get email notifications when this happens in a form like: /bin/bash: line 1: ...
0
votes
0answers
19 views

How to execute command with cron and additional parameters?

I have a command that should be executed every 30 days. It is easy to put it on cron and do that job for me, but the issue is that after execution the program asks to enter option '1' or '2'. I don't ...
3
votes
1answer
224 views

Why is the `cron.hourly` line in `/etc/crontab` the only one without `test -x /usr/sbin/anacron`?

I haven't changed my /etc/crontab, yet. It's still the default content, which is also the default content for many Linux distros: # /etc/crontab: system-wide crontab # Unlike any other crontab you ...
0
votes
0answers
24 views

How to resolve output result from crontab different with the output result by manually running the script?

How to resolve if output result in text file from crontab is different from the output result when i manually run the script in Linux? Example : Ifconfig output from crontab is empty. Thanks! ...
0
votes
0answers
92 views

Kill process at absolute time

I wish to run a command for the longest period possible and kill it at a certain absolute time (if it is still running), something like: killat "2018-06-09_23:55" ./myscript.bash The resources I've ...
5
votes
1answer
157 views

mount and umount behaving differently when run under cron

Running CentOS 6 in AWS, and what I'm seeing is baffling me. There is an s3fs mount in /etc/fstab that sometimes loses its ability to read and write from. I have a cron job that worked great for ...
0
votes
2answers
85 views

Set wallpaper from cron in xfce4

I've written a little script createCountdownWallpaper.py that is supposed to re-render the wallpaper /tmp/wallpaper.png every few minutes, and a script setWallpaper.sh that looks as follows: #!/bin/...
1
vote
0answers
29 views

Change the shell anacron uses to run a job?

Can I change the shell anacron uses to invoke the command? For example, given the following line in the anacrontab: 1 0 some-job echo "hi" Anacron will, by default, run this like /bin/sh -c 'echo "...
0
votes
1answer
240 views

If statement not working in cronjob

bash cronjob continues to create a new process even though my if statement tells it not to run if the process or port already exists... cat /etc/crontab */1 * * * * root /opt/script.sh also tried: ...
1
vote
1answer
242 views

Using Cron to Ensure a Background Process is Running

I'm trying to run a PHP background Process that is a consumer for Rabbit MQ messages. I can simply run the script as "php receive.php &", but I need to ensure that this script is always running. ...
0
votes
1answer
289 views

transmission-daemon changes config folder on reboot

I am not sure why but transmission seems to be changing my settings on reboot. The folder where the settings are being held is /etc/transmission-daemon. I run the command sudo service transmission-...
0
votes
1answer
234 views

How to run a periodic scheduled job without at or cron

Scenario: You have a user with no access to cron and need to schedule a job (say an rsync of a directory). The use of at is not an option as you don't have a fixed end date. While I bet there are ...
0
votes
1answer
118 views

Cronjob taking a screenshot every hour with scrot

One of my users needs a webpage screenshoted every hour. I was able to find a utility called scrot and it was easy setting up a cronjob to run every hour. My issue is it takes a screenshot of both ...
0
votes
1answer
429 views

syntax error near unexpected token `>' in script run by cron

I'm writing a shell script for Mac OS/Linux. The script is run by a cron job. I'm trying to append stdout and stderr to a log file. My command(simplified) looks like this(line 5 in myscript.sh): ...