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
5 views

Does using wget in crontab log me in every time?

In crontab I've defined a wget job to run every minute. $ tail /var/log/auth.log May 10 15:07:01 status CRON[5945]: pam_unix(cron:session): session opened for user pi by (uid=0) May 10 15:07:01 status ...
1
vote
1answer
17 views

Crontab not logging to file

I have the following cronjob: @reboot /usr/local/bin/python3.9 /home/pi/push_bullet/push_bullet_socket.py >> /var/log/push_bullet_socket.py.log 2>&1 It's the only thing on my crontab. ...
0
votes
0answers
9 views

Schedule REAR backup is not executing on RedHat Server

I have been tasked to manage a Red Hat server that we have onsite. The Version is 7.3. I'm quite new to linux and its Terminal. The problem I ran to is that I scheduled a Rear mkbackuponly -v on ...
0
votes
0answers
24 views

Crontab not running .sh script

I have the below script scheduled in cron but it doesn't fire off every night. However when I manually run it there is no issue. I've even tried to change the script to create a txt file but that didn'...
0
votes
0answers
24 views

Strange crontab behavior in OS X, why won't mdfind work correctly?

osx 10.15.7 The short of it is that i have a shell script which invokes the mdfind command. When attempting to execute from cron, the script runs but no results are returned, despite the command and ...
0
votes
1answer
39 views

Python script using Crontab

I've written a python script that will check my roster for work (which is in google sheets), take some relevant details, place them in an email and send them to me. When I run this script manually ...
0
votes
2answers
23 views

Run terminal command on boot using crontab

I have a server and on every boot, I have to enter npm run dev on the terminal so Node.js server starts. How do I use crontab to do it for me on every boot? I want something like this; @reboot echo &...
0
votes
0answers
29 views

Trying to create a cron job to run journalctl to run a job that is to place a text file under another user's home folder, getting permission denied

So I'm doing some homework and my 18+ hours of research has not gotten me very far. My homework activity is asking me to create a cronjob using journalctl to perform a daily task. But I'm running on ...
3
votes
1answer
79 views

certbot-auto fails to install automatic renewal?

I am using kernel 3.10 on CentOS 7. I have successfully installed CertBot 1.10.1 using alternative installation instructions as certbot-auto. Running certbot-auto successfully generated certificates ...
0
votes
0answers
56 views

Having bad minute error while writing a cron job in RHEL 7.9

As stated in the subject my question is about writing a cron job in Linux. I have written a simple cron job which is stated below: * * * * * echo Testing > /home/ipnsadmin/testing.log But when I ...
0
votes
0answers
27 views

Crontab Terminal command

How can I execute a terminal command via crontab? I have created a sh file with the following content: #!/bin/bash sudo hdparm -y /dev/sda1 and creates an entry in crontab: */10 * * * /home/server/...
0
votes
1answer
36 views

S3 command not working in cron

I have this ultra simple cron job: 48 20 * * * cd /home/pankaj;s3cmd -f get s3://myfile.gz The command works by itself. But the cron job does not. The cron job is created for the same user(pankaj) ...
1
vote
0answers
90 views

Why can't I execute shell script via crontab?

I have this script shell1.sh ubicate in /home/documents/files, the script is for the creation of users on Linux, so it asks for some information and later creates the user. I want it to run for every ...
0
votes
1answer
26 views

System crontab won't run for certain user on Centos 7

I have a super simple system crontab to run as a specific user. For a user that can login to a Gnome session it works fine. For another user that I use just for system tasks, it will not run. This is ...
0
votes
0answers
42 views

Unable to run a script through crontab in linux

When I try to run a script through crontab, it doesn't work. I don't see my script running when I run `ps aux. But it works perfectly when I run it manually. Any reason why it's not working? My script ...
0
votes
2answers
55 views

Crontab entry is not working

I want a set of files copied daily from a remote server to local machine at 5 am in the morning. The following crontab entry does not work: 0 5 * * * scp user1@192.168.5.54:/tmp/bkp*tar.gz /home/...
0
votes
0answers
9 views

If crontab is set to run a script at the Nth minute of every hour and any linux machine boots in that hour, will that script run?

If for example, crontab is set to run a script at minute 32 of every hour and the computer boots at 12:32PM, will the script be executed? Also, is this the same on all linux distros? (I am a Linux ...
0
votes
0answers
27 views

Scheduled cron job is now working in Linux system

I am planning to schedule a shell script that needs to run for every 5min. In the corn tab, I have a few other jobs also scheduled. Below is the entire Cron tab data. */2 * * * * ~/aws-scripts-mon/mon-...
0
votes
1answer
65 views

How would I make a cron job stop and start again?

I am trying to make a cron job that stops at 12am today(friday) then start again Monday at 7am, what would the script for this look like, I am new to cron jobs.
0
votes
0answers
38 views

Mac osx and Crontab doesn't delete files

I have crontab like this. ❯ crontab -l * * * * * ~/.scripts/run.sh * * * * * find /Users/username/Documents/temporary/db_backup/ -mindepth 1 -mmin +5 -delete * * * * * /usr/bin/find /Users/username/...
1
vote
1answer
937 views

How to log the output from an rsync backup which runs from a script using crontab?

I would like to log all the output that is generated by rsync; the output that I see when I run the script myself in terminal. I would prefer this logging to occur from within my script. Here is my ...
0
votes
0answers
17 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
134 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
1answer
121 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
73 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
82 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
133 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
17 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
33 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 "...
1
vote
1answer
705 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
497 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
148 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
55 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
261 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
1answer
223 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
990 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 ...
2
votes
2answers
1k 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
85 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
561 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
384 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 ...
1
vote
1answer
44 views

Cannot autorun a bash script containing notify-send 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 ...
1
vote
0answers
56 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
58 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
475 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 ...
1
vote
0answers
56 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
25 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
77 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
184 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
65 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
55 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 ...

1
2 3 4 5 6