Questions tagged [crontab]

Crontab is a short form of cron table. It is a configuration file that specifies shell commands to run periodically on a given schedule.

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

How to stop a service using crontab?

I am trying the following code inside crontab and it works for starting the service but the stop part doesn't work! 25 10 * * * systemctl start python-script 2&1 >/dev/null 26 10 * * * ...
0
votes
0answers
11 views

How to test cron @reboot entry?

How can I test if @reboot is working without the need of reboot the machine? Is there anyway to force @reboot to entry to run? Thank you.
0
votes
0answers
34 views

Why is cron daily jobs starting to work 7 minutes after midnight and suppose to do that at 6:25?

I have Ubuntu 18.04 and installed automysqlbackup to backup all of my MySQL databases. For some reasons, it started to “kill” my MySQL databases (and IPS forum running with this database is not ...
0
votes
1answer
36 views

pacmd command run in local crontab does not work

I am trying to run certain commands at startup to allow my Audio to be FIFO Piped into a file. If i run the commands (either manually or in a script) it works fine. However when i put them in my local ...
0
votes
1answer
32 views

Updating Debian Linux via crontab

I am trying to have my Raspberry Pi do its own update weekly with the following command Not certain which one to use because running the command with su root fails on my terminal. 59 2 * * 1 root ...
0
votes
1answer
30 views

mysqlimport gives error when run as cron job but not interactively (Ubuntu 14.02)

I have a bash script which downloads and then imports a CSV file into a local MySQL. The database is MySQL 5.6 on Ubuntu 14.04, I'm loading data with the following statement (bash): mysqlimport --...
0
votes
1answer
40 views

Executing a script on boot in lubuntu 19.04 to connect to VPN (rc.local and crontab issues)

I am new to Linux and I am wondering how to make my virtual machine with Lubuntu 19.04 automatically connect to a VPN on boot. the VPN I chose is Proton VPN and I have to execute this command to ...
0
votes
0answers
16 views

Apache-tomcat stops at regular intervals

I need to start tomcat every morning. One thing I suspect is there is a crontab written to clear the Catalina.out at Midnight, does it lead to stopping of tomcat by any means? echo '' > /opt/apache-...
0
votes
0answers
13 views

cron output sent by mail instead of to file

On Debian 9.11 I added this to root's crontab: * * * * * echo $PATH &> /root/TMP.log I expected PATH to be written to the file, but the result is an empty TMP.log and the output sent to root ...
0
votes
0answers
16 views

crontab -e run as root and not as user

When I am login as a user (lets say: John) to may linux (Ubuntu 18), I run the command: crontab -e I then entered a simple command: python pythonFile.py I was expecting the job to run under user "...
0
votes
1answer
230 views

“Must be connected to a terminal.” in screen

I'am using a script for an automatic server restarts after crashes etc. It's a fiveM(GTA V) server. Everything is workin on crontab, and there are some lines in this script to check out if server is ...
0
votes
0answers
60 views

Run a cronjob on every month 2nd thursday [duplicate]

I want to generate a report by executing a python script. This script has to run on every 2nd thursday of a month, 3.30am . How to achieve this. Below code might work, if the dates are fall under 8-...
1
vote
1answer
86 views

Restart ea-tomcat85 from crontab

I have written a script to restart tomcat service # timestamp ts=`date +%m-%d-%Y_%H:%M:%S` echo "$ts: Restarting ea-tomcat85..." &>> /home/account_name/restartservice.log ubic restart ea-...
0
votes
0answers
33 views

How to disable/block crontab for non root users in Ubuntu

I have a server with Ubuntu 16.04 and create users per website. I want that those users could not run crontab -e command. Those tutorials do not work: https://www.thegeekdiary.com/how-to-prevent-non-...
0
votes
0answers
34 views

Convert crontab commands to systemd?

I am using crontab in centos and I am having many problems such as some commands are not executed or simply not running any and simply deleting the crontab file and putting the same lines back is ...
0
votes
1answer
109 views

What effect is using /etc/cron.deny supposed to have?

Does adding a user to cron.deny deny cron jobs from running or the ability to edit the crontab file? The man pages say: Running cron jobs can be allowed or disallowed for different users. For ...
0
votes
0answers
29 views

Stop Cron job at 5:30 pm

I need to hace a a cron job which runs every minutes, everty days but only . I want to stop this cron job running on Sundays between 4pm and 5pm - it should start again after this time. How can I ...
0
votes
1answer
60 views

how to add timestamp to file names when moving them to cloud storage using cron job in ssh

I have built an ftp server on google compute engine that receives data from on prem systems as csv. I want to move this data after receiving it to a google cloud storage using a cron job from the vm ...
0
votes
1answer
160 views

Run missed cronjobs when computer turns on

I have some cronjobs running at certain times of the day but sometimes my computer is switched off when they are scheduled to run. Is there anyway for these to run as soon as the computer is turned ...
0
votes
0answers
53 views

Is it possible to reboot a linux server with a crontab script when the server hangs/freezes/becomes unresponsive?

Is it possible to reboot a linux server with a crontab script when the server hangs/freezes/becomes unresponsive? If so, how can I do it ? All help will be greatly appreciated!
2
votes
2answers
473 views

script with “export” command in a crontab

I have this in cron tab: * * * * * /root/attente.sh and attente.sh : export attente=$(cat /root/switchboard.txt) If I run export attente=$(cat /root/switchboard.txt) in a shell it works but not in ...
0
votes
1answer
39 views

Attaching to a screen session on boot

What I'm trying to do is start a screen session on boot via crontab and then have the user automatically connect to that session. Here's my current cron file: # Edit this file to introduce tasks to ...
0
votes
1answer
411 views

My production server was breached and I found this script. Is it a decoy?

A few days ago my VPS came under heavy load from spammers trying ssh attacks and script injections. I have since added new fail2ban regexps and new security measures for REDIS where it looks like they ...
0
votes
2answers
151 views

Crontab Running Script Every Minute

I am currently trying to schedule a cronjob to run a .sh script file every minute. This is my simple script: #!/bin/sh echo "Hello World" >> /Users/navania/crontab-scrip.log I saved this on ...
0
votes
1answer
23 views

Cannot autorun a bash script at the startup

I'm using Linux Mint Cinnamon 19. I've written a simple script #!/bin/bash #test notify-send "text" "other text" -i dialog-warning to notify me when it's executed. In order to run the ...
0
votes
0answers
47 views

Crontab returning ambiguous redirect error

Can someone please help? I have a crontab code that was running normally until yesterday... Somehow now it´s returning "ambiguous redirect" error. I´ve created the cron file using crontab -e MAILTO="...
0
votes
0answers
80 views

Crontab segmentation fault

For some reason, my crontab is giving me segmentation fault (core dumped) error when ever I attempt to access it using crontab -l or crontab -e. Everything is fine if I access the root crontab or ...
1
vote
0answers
38 views

Cron Behavior in HP-UX

I am trying to monitor my server through a script which is run by cron in HP-UX environment. However, an if-else condition is not working correctly when run by cron. For example, if certain condition ...
0
votes
2answers
30 views

cron job not executing the binary in the time specified

I would like to check which is the environment being used if executing a cron job. I had it working before however it stopped at some point. This is my cron job in the crontab file: 20 13 * * * /usr/...
0
votes
1answer
128 views

Script started by cron is unable to execute iptables command

i wanted to run cron file on boot and execute system command, everything works well, but if i'm calling iptables command with some arguments like: iptables -A INPUT -s 192.168.0.161 -j DROP command ...
0
votes
0answers
23 views

Crontab Sends blank email

I am writing a cron job that sends an email from a file using sendmail. Running the script manually works fine and uses the contents of the file. My script is just this #!/bin/bash sendmail me@...
0
votes
0answers
35 views

Crontab in HP-UX is not accepting scripts to be run under 1 hour

I am trying to run a monitoring script on my server where I need to monitor the health status of the server. The script needs to be run every 5-10 minutes. Following is the attempt I had. 0,10,20,30,...
1
vote
0answers
45 views

How do I make a python script executable on macOS Mojave?

Alternatively, I'm having trouble getting a crontab to run a python script, and I thought this would solve the problem. If you happen to know how to make a crontab run a python script, that would be ...
0
votes
1answer
23 views

Executing the commands stored in a crontab

I have setup a few commands to run every night using cron. When I don't leave my laptop running overnight, these commands will not be executed. I can't use anacron because it's not available on my ...
0
votes
1answer
28 views

Screen as a Service on Ubuntu 18.04

I have an application that occasionally closes due to some runtime error or DDOS attack. The application runs inside a section of the Screen, so I need to access the server and type the command screen ...
0
votes
1answer
118 views

How to schedule a cron job to run every tuesday between specific dates of every month?

I want to run my cron job at 4 AM on every Tuesday between 4th and 24th of every month. Can someone help me with this. It shouldnt run outside the 4-24 range. Inside this range, it should run only on ...
0
votes
1answer
64 views

How cron job works

I am new to linux. I have a cron job 'A' which should run every week i used crontab-e to set it let say 3rd march 15:00 i did this. Now today (6th march) i have to add another job 'B' which should ...
0
votes
1answer
42 views

How to know why crontab job is not executed

I have set several cron jobs. I recently added a new cron job that copies a file of last day from another server and is executed each day (for example at 06:00 am) but when I check next day the file ...
0
votes
1answer
241 views

How can I run a script through crontab with a value input for the script?

im trying to run a script with crontab on linux as follow, i create a script for a incremental backup. when i excecute in the command line/usr/bin/diego-backup.sh complete the script creates a ...
16
votes
2answers
2k views

Cron runs only once instead every minute

I'm trying to run a script every minute (on a Docker container running Ubuntu 16.04). The /etc/echo.sh simply echo the word "hi" cat /etc/crontab * * * * * root /etc/echo.sh > /var/log/cron.log ...
0
votes
1answer
31 views

How to check cron modified time?

How to find cron job modified time in Ubuntu, For Example: when the cron job has been modified or changed.
0
votes
0answers
149 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
43 views

How to start a service at startup

I am using Ubuntu Server to make a Kodi box. I'm using kodi-standalone-service to do so. I have made a shell script (sudo -S <<< "password" systemctl start kodi) to start kodi. When I run it ...
0
votes
1answer
96 views

How to check whether my script ran successfully in crontab

I am new to Unix and I need some help to know how to check whether my script has picked by crontab and ran as per schedule (not manually).
0
votes
1answer
75 views

Linux Crontab backup not working for a folder in root

I have a directory located at root... cd / li drwxrwx--- 8 root fred 4096 Nov 3 15:28 ourdirectory Created a sudo crontab command... 20 8 * * 1-7 sudo tar -cpzf /mnt/backupdrives/backup.tar.gz /...
-2
votes
1answer
686 views

gzip command is not working in shell script [closed]

If I run my script through crontab, gzip is not working fine. If I run the same script manually gzip is working. The command we have in our script is gzip -vf $path/file.eee In my script I am ...
0
votes
3answers
84 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 ...
4
votes
1answer
4k 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
1answer
563 views

How to use brew in crontab

I run an alias in my .zshrc file every day. alias buou="brew update && brew outdated && brew upgrade" I want to run it by crontab on my macOS v10.13.6 I made a file called ...
1
vote
0answers
778 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 ...

1
2 3 4 5 6