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
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [cron]

Cron is used to execute scheduled commands. It acts as a task scheduler on Linux and UNIX systems which will execute commands at specified times set by the user. Cron has a great deal of customization and is often used on server environments where common tasks are run on a regular basis.

0
votes
2answers
25 views

Why my cron routine doesn't work

When I put * * * * * /var/www/script.sh Script is executed once per minute, but if I put * */2 * * * /var/www/script.sh instead, script doesn't execute at all
1
vote
0answers
17 views

An uninvited visitor file 'mbox'

I check the home directory and find a extra files 'mbox' me@alpha:~$ ls -l | grep 'mbox' | sed "s/$USER/me/g" -rw------- 1 me me 315392 Jan 19 23:10 mbox -rw-r--r-- 1 me me 0 Jan 19 23:10 ...
1
vote
0answers
42 views

How to turn off display on 18.04 server no gui

I would like to have the display turn off while not logged into the system. I can't find an easy way to do this. I am new to Linux, and I tried this command setterm --blank 5 and added it to crontab,...
0
votes
1answer
37 views

setting up rsync cron job, not executing

So I have just setup my new Ubuntu Server 18.04. I have the main primary OS installed on an SSD, the second HDD (primary media drive) mounted to /media and the backup drive mounted to /mnt. I have set ...
1
vote
0answers
36 views

bash script started through cron (root) not ending as expected

I have a script as follows, and I am trying to run it as a root cron job. The script starts mycommand, which in turn starts another process. When a condition is met, I would like the script to kill ...
0
votes
0answers
14 views

How to stop cron from running all daily tasks on startup

I noticed my computer is slow on startup sometimes, and using iotop it looks like cron's daily tasks (updatedb.mlocate in this case) run immediately on startup. If my conjecture is right, then I need ...
0
votes
0answers
54 views

VIDEOIO ERROR:V4L: Can't open camera by index 0

On a Intel NUC, I have loaded Ubuntu 16.04. I have disabled the desktop module by making changes to /etc/default/grub. The machine boots in text mode. I have a python program that uses Opencv (...
0
votes
0answers
11 views

Need to logoff guest users after certain period of time

I have an interesting problem and need an interesting solution. I am trying to set a timed user session on a work computer and want to log whoever off after 30 minutes on a guest session. since guest ...
0
votes
1answer
28 views

Where can I find the output log from a custom crontab task [duplicate]

I configured a regular task me@alpha:~$ crontab -l | grep '^\*' */5 * * * * (cd ~/Documents/OrgMode; git add .; git commit -m "defensively save") It works but I cannot find the log in mail.log me@...
1
vote
0answers
45 views

How can I set a variable each day that is used by my daily scripts

How can I update a variable each day, that each of my daily crontab scripts would have access to? I'm trying to set a random number, that changes each day, and read it from my scripts. Here is what ...
0
votes
0answers
40 views

problem to run script.sh in crontab [duplicate]

I would like to run a script with crontab -e. I'm running ubuntu 18.10. In terminal it works. #!/bin/bash #themes day=Yaru night=Yaru-dark #time time_start=7 time_end=20 currenttime=$(date +%H) if ...
1
vote
0answers
87 views

Trouble with a crontab script modification failing

I have a crontab that calls a script syslogtar.sh in /usr/bin. It is in my path and has been running fine for over a year. The script goes into each firewall log directory runs a find command pipes ...
2
votes
1answer
55 views

Cron Monthly job works randomly using `0 0 1 * *`

I have this sudo crontab -e job entry I setup in April then forgot about: 0 0 1 * * /bin/journalctl --vacuum-size=200M What it does is keep down the size of journalctl files each month ...
0
votes
1answer
44 views

How can I delete time-stamped folders if one has already been created that day?

Folders are created every time I (re)boot. They have the format below: (the time will always vary) .mozilla_2019_01_08_08:02 .mozilla_2019_01_09_20:16 .mozilla_2019_01_10_01:16 ....
3
votes
1answer
57 views

How to suspend/resume cronjob if one is already running?

I've tried this solution to prevent duplicate cronjob from running. 30,31 12 * * * /usr/bin/flock -n /tmp/my.lockfile ~/Desktop/test.sh >> ~/Desktop/test.log 2>&1 and script test.sh has ...
1
vote
0answers
30 views

Startup Application and @reboot cron not firing - what to look for?

I have an issue with my dual monitor setup: one is touchscreen and the other is not - the touch input correlates across both displays instead of just one. I can resolve the issue by mapping the input ...
1
vote
1answer
23 views

Cron job not running for a specific user for nodejs

I installed nodejs for my specific user. I implemented a price feeder application and when I do a whereis feeder I get the following output: feeder: /home/user/.nvm/versions/node/v11.6.0/bin/feeder ...
0
votes
1answer
35 views

How to schedule python script in a folder using crontab

I have some python scripts saved in a sub-folder called "Documents/downloadFundamentals" And I have the following bash script: /home/john/.virtualenvs/investFundamentals/bin/python scrapStockList.py ...
-1
votes
0answers
51 views

Crontab database backup files - no such file or directory

When creating SQL database backups, using the following cron job: 50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql I cannot download the ...
1
vote
1answer
39 views

Run /etc/cron.daily from specific user

Do I properly understand that it is not possible to run /etc/cron.daily/my from arbitrary user, it will be run only from root according to /etc/crontab? Can I drop root privilege to specific user in ...
1
vote
1answer
34 views

How to move N lines from one file to another

I want to download multiple files, so I decided to create 4 text files that are handled with a script. toDownload.txt | this file will hold a list of links to download. inQueue.txt | the files ...
0
votes
0answers
17 views

notify-send no longer displays when the script is run by crontab? [duplicate]

My script uses notify-send to show notifications. These notifications do not display when the script is run via crontab, but do display when run from the command line (as my user) in Ubuntu 18.04 with ...
0
votes
0answers
21 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
0answers
40 views

Cron job stopped working

Hope someone can help, I have been using the following cron job for the last year to shut down my pc at night and then restart it the next morning 01 22 * * * /usr/sbin/rtcwake -m off -s 36000 For ...
4
votes
1answer
98 views

Run crontab in specific day but only if is in specific weekday

I wanna run command with crontab in a specific day, but only if this day is not sunday. I tried with this 1 0 27 12 1-6 command.sh but the command run also wednesday december 26th. How can I ...
0
votes
1answer
52 views

how to make a new Cron job for python scripts to update mysql?

I'm a newbie to setup a Cron jobs. i have a prefix directory for my application python on /usr/local/lib/python2.7/dist-packages/prewikka and i already to new environment for my application python as ...
0
votes
1answer
44 views

Bash file automation

I have scenario like below : I have a bash file named infra.sh. Inside this infra.sh file I have the below commands: #!/bin/bash gnome-terminal -e 'sh -c "bash ./redis-server.sh && sleep ...
2
votes
0answers
21 views

How can I run 2 task on reboot at 10 min apart in ubuntu [duplicate]

I am trying to run 2 tasks at reboot on Ubuntu VPS. I know that I can setup crontab job for it, by doing "@reboot Taks1" "@reboot Taks2" But what I want is to run the 1st task at reboot and 2nd task ...
0
votes
0answers
16 views

Cannot reload a service with cron in Ubuntu 16.04

I have a script that updates my ssl certificates and reloads squid to make it update its certificate once it is regenerated: certbot renew service squid reload I put it to /etc/cron.monthly/certbot-...
0
votes
0answers
28 views

How to configure mail in Ubuntu for crontab service?

I am in Ubuntu. My cronjob is not running at all. I was thinking it is because of this mail issue. I ran a mail command I got └── mail ...
0
votes
1answer
21 views

Network activity for decision to suspend/hibernate

i have a small server (ubuntu server) which i am using on demand. Meaning it switches on from suspend on request. I was trying to find a way, using cron to put the server to sleep after 90 min of ...
0
votes
0answers
18 views

Logrotate not rotating error.log but working on other access logs

I'm trying to get logrotate to rotate the nginx error.log that sits in /var/log/nginx/error.log. I've got the following config and this is successfully rotating the website logs that sit in /var/log/...
1
vote
1answer
50 views

Using npm to install file to /usr/local/bin

I tried to install a file using the following command: npm install -g price-feeder It's supposed to be installed in the /usr/local/bin folder since it's using the global parameter to be accessible ...
2
votes
1answer
77 views

xrandr not working on crontab

I'm on Ubuntu 18.04 64bit, I'm trying to save the resolution of my 2 screens so I'm trying to put a script who uses xrandr to set it (if I execute the script from the terminal it works), so I put it ...
0
votes
1answer
48 views

How to use cron job to execute python script that sends emails without using MTA?

I've defined a cron job which use python script to send mails to office365 users emails from office365 email. 15 16 * * * 3 cd /home/path_to_app && /home/path_to_env/flaskvenv/bin/python -m ...
0
votes
0answers
47 views

Wallpaper rotation with python and cron [duplicate]

I've written a small piece of python which generates a list of eligible wallpapers from my art collection and then sets a random one to my desktop background. The code works, and if I run it manually ...
0
votes
0answers
69 views

First bash script: computer to dropbox backup help

I have the following script in /.backup with a symlink to cron.weekly. The goal is to have my entire system encrypted, compressed, and saved to dropbox every week. This is my first bash script and I'm ...
0
votes
1answer
20 views

cron processing only half of script

script: curl -s http://api.ipify.org > ~/ip.txt && [[ -s ~/ip.txt ]] && ip=$(cat ip.txt) && echo $ip > ~/newIP.txt || echo WAN IP is blank: curl, latency or internet ...
0
votes
2answers
33 views

Error in crontab

I'm putting the following instructions: 00 12 * * * /usr/bin/php -q -f * * * * * * /var/www/html/glpi/scripts/ldap_mass_sync.php action=1 * * * * * * ldapservers_id=1 But I'm getting the message: ...
0
votes
1answer
77 views

Ubuntu 18.04 is accepting cron job

I am trying to set a cron job in ubuntu18.04 but it is giving me error of command not found root@UB-Machine:~# * * * * * env > /tmp/env.output Machine: command not found I have tried restarting ...
0
votes
1answer
297 views

Having “PAM adding faulty module: pam_winbind.so”, “… pam_kwallet5.so”, “… pam_kwallet.so” on start of smbd, ssh, cron daemons - why and how to fix?

I'm using Ubuntu 16.04.5 LTS. I tried to read my log files for errors. The most interesting are the following: cat /var/log/auth.log | egrep "unable|faulty" Nov 25 13:25:13 localhost su[4491]: PAM ...
0
votes
0answers
85 views

.sh script not working with crontab but does run standalone fine. Ubuntu 18.04

I'm having trouble getting this script to work with crontab. The script works standalone when ran. I'm running Ubuntu 18.04. Here is the script. It's a simple backup script which uploads a compressed ...
0
votes
2answers
43 views

Bring a cronjab back to foreground

I've set a cronjob to upgrade my ubuntu in /etc/crontab: 0 2 * * 1 root apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1 Now, in ~/upgrade.txt, this line is ...
0
votes
0answers
23 views

Can't Open Display error when trying to set resolution at startup

I connect with my Ubuntu 16.04 headless box from my Windows machine using TeamViewer 14. The default resolution is 1024X768 and this is dictated by my Linux machine. I have finally figured out a ...
0
votes
1answer
78 views

How to stop apache2 service

I need to stop apache2 service for 3 hours during the backup time. How can I do this through crontab or similar ways... I tried with crontab: 15 14 * * * service apache2 stop But nothing happens. ...
0
votes
1answer
67 views

Problem with my bash script or crontab

My LAMP installation on Ubuntu 18.04 LTS is working fine. But sometimes when MySQL is down it doesn't gets restarted automatically. So i google around and found below the bash script which checks ...
0
votes
0answers
42 views

Cron not running on webmin

I have scheduled a cron on webmin as shown in the screenshot, but it is not being executed. (Click image to enlarge)
0
votes
1answer
67 views

Having trouble getting .sh working with crontab

I've checked this link for suggestions but I can't seem to get a .sh script working. I'm new to Ubuntu and Linux (from Windows). Why crontab scripts are not working? Here is the dummy .sh I'm ...
-1
votes
0answers
15 views

Ubuntu 16.04 - create a cron job that runs just before logrotate

I want to upload my apache logs to a remote FTP server, wich i have allready managed to figure out how to do. However. I could inject the code in the logrotate cron job, but i am worried it would ...
-1
votes
0answers
29 views

strange cron job keep running in my ubuntu 16.04

as u can see, the cron job run as root every minute and output something to /dev/null. it didn't happen in other machine, i guess i have been hacked? however, this is suppose a internal used machine, ...