Questions tagged [cron]

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

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

aaPanel - Unable to exclude a directory / file from getting backed up using Cron Jab

I am using aaPanel 6.5.2 on Linux 18.04 LTS. aaPanel is a free alternative to cPanel. aaPanel provides the facility to create Cron Jobs for taking backups out of the box. It's very easy. I have set ...
1
vote
2answers
34 views

CRONTAB, When to set path variable [closed]

I have two bash scripts that both work when I run them. However when I try to run them in cron, one script(Scipt 2) works and the other(Script 1) does not. I have narrowed down the problem to ...
0
votes
0answers
24 views

What does “UNSAFE” mean in /var/log/cron?

I've noticed my cron log (/var/log/cron) is showing that cron is running tasks as desired. However several minutes after a job runs cron logs an entry showing UNSAFE with my user name following. What ...
0
votes
0answers
17 views

Checking and programming crontab in the same script [duplicate]

I have to deploy a script on different machines in a large network that will be checked every 5 minutes. The script is very simple: #!/bin/bash if [[ ($(command)) ]]; then output fi asd ...
-3
votes
0answers
25 views

CronJob Issue Centos 7 - Centos webpanel

The following cronjob don't work in my server and I don't understand the reason (I'm a newbie), somebody can help me? Cron: curl "some-URL" >/dev/null 2>&1
0
votes
2answers
89 views

Hide a crontab job

Is it possible to add an entry to crontab and make it hidden so that it does not show up when the user is using crontab -e or crontab -l? I know PPP was once attacked with technique during a Defcon ...
0
votes
1answer
38 views

Crontab not working on specific time

My command is Cat > a.sh mkdir abc Chmod 777 a.sh Crontab -e 56 09 * * * /home/subir/Jarvis/a.sh Doesn't create abc directory at that given time. Puts excuete permission also
0
votes
1answer
35 views

Cron loop best practices

I wrote a script that loops through every file in a folder and performs a simple operation on each file. That folder will almost always be empty and only occasionally contain a file, but I'd like the ...
1
vote
1answer
38 views

Multiple, sequential commands in cron

I read about the following 2 ways to run multiple commands in a single cron job: We can run several commands in the same cron job by separating them with a semi-colon (;). * * * * * /path/to/...
0
votes
1answer
42 views

Crontab to make directory in Desktop [closed]

why cronjob is not working for the below command. my current location is "desktop" touch a.sh # created a.sh file vi a.sh mkdir abcd/ # a.sh content command crontab -e * * * * * /subir/home/...
1
vote
1answer
19 views

Cron Issue w/ Some Commands and Perl Script

I have searched the Internet for hours for a solution to my issue, and I can't seem to find an answer or solve what I'm doing wrong. I am trying to set up a cron to run a perl script on a regular ...
-1
votes
2answers
92 views

how to start a script with root privilege on boot?

I tried with systemctl and with crontab without success. here is the script: #!/bin/bash cyberghostvpn --country-code AU --city Brisbane --connect rights : -rwxr-xr-x 1 pat pat 71 nov 28 13:04 ...
0
votes
2answers
33 views

Conditional crontab entry

I have a crontab entry that executes a script and stores the output in a file say currenthash.log as an MD5 hash. But I'm unable to achieve a requirement where I need to create a new file say ...
0
votes
2answers
20 views

cpulimit is not actually limiting CPU usage

I'm calling cpulimit from cron: 00 16 * * * /usr/bin/cpulimit --limit 20 /bin/sh /media/storage/sqlbackup/backups.sh When the job kicks off, the CPU spikes and alerts as it always has, with no ...
-1
votes
0answers
26 views

How I can find out whether a service has been restarted on reboot?

In my crontab I have placed the following: @reboot service codedeploy-agent restart In order to restart the codeploy agent. But I want to know whether on the last reboot the crontab actually has ...
0
votes
1answer
41 views

Timeshift weekly cron emails

I recently installed timeshift and set it to backup weekly. However, when I looked in /etc/cron.d, I only found timeshift-hourly which ran: 0 * * * * root timeshift --check --scripted which appears ...
0
votes
0answers
9 views

Cron run backup no more than once every two days at some time when laptop is on

I have a backup script that runs on my laptop. I can't guarantee a specific time my laptop will be on. I want the script to run no more than once every two weeks. My current solution feels very hack-y,...
0
votes
0answers
19 views

Crontab -l command delete this contrab that is off the root?

I cannot seem to delete this file which is located off of the root, not a user, and is displayed by the contrab -l command. -r has been tried and isn't working, perhaps because the user is root. I'm ...
0
votes
1answer
97 views

connect() to unix:///tmp/uwsgi_dev.sock failed (2: No such file or directory) while connecting to upstream

I tried to run django application using uwsgi+nginx and the cronjob command is,* * * * * /usr/local/bin/lockrun --lockfile /path/to/lock_file -- uwsgi --close-on-exec -s /path/to/socket_file --chdir /...
1
vote
1answer
28 views

How to suppress cronie logs under systemd?

I have a job scheduled in cron (cronie 1.5.1-r0). It fills my syslog (systemd 234) with Nov 19 11:02:01 hometest CROND[1031]: (root) CMD (^I/usr/bin/some_script.py) because I do this every minute. ...
3
votes
0answers
40 views

Encrypting Passwords In Linux For Later Use

This is an interesting read that I found regarding encrypting passwords for later use, https://4sysops.com/archives/scheduling-powershell-scripts-with-usernames-and-encrypted-passwords/ Essentially, ...
0
votes
1answer
18 views

stop/restart background job started by cron

I have the following cronjob which pipes docker (apache) logs into a file: * * * * * flock -n /srv/www/htdocs/scripts/pipe.lock /srv/www/htdocs/scripts/pipe_docker_logs.sh the pipe_docker_logs.sh ...
0
votes
0answers
18 views

How to add crontab task by reboot / poweroff / poweron pc?

I have next record in crontab -e, running with user root. @reboot /usr/bin/curl --silent --insecure -v -X GET https://<myserver_with_hook>?key=9d722304320de0b074d8da74bf680874&mes='nik-pc ...
0
votes
1answer
31 views

mutt showing headers in email content when emailed from crontab output

When I'm sending an email using mutt (output of a script from cron/cronie) I get the following lines at the beginning of my email: To: myemail@myemail.com Subject: Cron <root@alarm> /home/alarm/...
0
votes
0answers
27 views

Why is my cronjob not executing my script?

I can run this perfectly fine out of my terminal. #!/bin/sh echo HELOOOOO export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data1/home/me/SikuliX/libs cmd="~/Desktop/Git/program -ts" nohup ~/Desktop/Git/...
0
votes
0answers
15 views

Send each file in a folder to different mailing group using single crontab job rather than multiple jobs

Suppose I have x, y and z files in a folder and I want to send each file to a different mailing group(A, B and C) using single cron job and not 3 jobs. Is it possible? The reason for this is I am ...
1
vote
0answers
44 views

Crontab is disappearing when ever we edit it

Crontab is disappearing whenever we edit it? crontab -l no crontab for the is the error the user is High privileged access account What can be the root cause? Any suggestions where to check?
0
votes
0answers
36 views

Cron job doesn't initiate backtick assignment

#!/bin/bash # taking the count of file whose name matches with FOO file_check=$(ls -1 $HOME/*FOO* 2>/dev/null | wc -l) echo "$file_check" >> $HOME/Test1.log Given there are 2 files which ...
3
votes
1answer
262 views

Cron entry for last Saturday

I want to schedule my script for last Saturday of every month. I have come up with the below: 45 23 22-28 * * test $(date +\%u) -eq 6 && echo "4th Saturday" && sh /folder/script.sh ...
0
votes
0answers
21 views

Copy files from a company share to public dropbox using rsync or find, etc

I am working to get a data transfer service up to which I can copy only newly created files in /h/data/share/(company share) to /g/data/global/ (public dropbox), however the files in /g/data/global ...
0
votes
1answer
61 views

'qt.qpa.screen: Could not connect to display' error when run python script at boot [duplicate]

I have searched this problem online but could not resolve it. Excuse my inexperience. I am trying to run a python script on startup which uses PyQt5 library to create a window. I am using a raspberry ...
0
votes
0answers
22 views

editing a cronjob using a script [duplicate]

i am wondering if it would be possible to edit a cronjob using a script. I want to show the current cronjobs, of which the user can select a number. it will then replace the number chosen with the ...
0
votes
1answer
24 views

mysqldump cron job filling up my syslog

I have the following job in my crontab: 0 */4 * * * /usr/bin/mysqldump -u root -p'PASSWORD' --all-databases | /bin/gzip -9 > /home/USER/_mysql_backup/`date "+\%F--\%H-\%M"`.databases.sql.gz ; rm -...
4
votes
2answers
61 views

Run udev script every minute (displaying Dualshock 4 Battery level)

I created a simple script that changes the Dualshock 4 Gamecontroller LED color bar based on its Battery status (using the answer https://gaming.stackexchange.com/questions/336934/how-to-set-default-...
3
votes
1answer
72 views

How to open the crontab of another user in my editor of choice?

I work in a team. We have a CentOS Linux machine. There's a user there called www. We run cron jobs as that user, i.e. I can type sudo -u www crontab -e to see/edit the crontab, and my teammates do ...
0
votes
1answer
77 views

Unable to redirect output of crontab -l to file

I tried backing up my Crontab to file using following command: crontab -l > backup/crontab. But this creates only empty file into directory backup and no output is printed to terminal. Exit code of ...
1
vote
1answer
57 views

Remote port forwarding with autossh from Raspberry PI to VPS in order to access the PI from anywhere on the Internet, why does it work only once?

I am using autossh with remote port forwarding from VPS to Raspberry PI in order to be able to access the PI from anywhere on the Internet, but it works only once. I have a Raspberry PI 2 (Raspbian, ...
1
vote
2answers
115 views

Can I avoid debian-sa1 lines in my syslog?

My syslog is chock-full of the following: Oct 28 23:35:01 myhost CRON[17705]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) Oct 28 23:45:01 myhost CRON[18392]: (root) ...
1
vote
0answers
23 views

What are the exact functions that cron and anacron tasks perform?

This maybe irrelevant but my OS is Ubuntu 18.04lts and I've been using KDE plasma 5 (kubuntu). I've been plagued by the possibility that cron and anacron are directly causing the crash of plasmashell ...
0
votes
0answers
26 views

Setting a calendar to run a program in Ubuntu

I have an application (shell script) for a client which needs to run daily according to a custom schedule, which needs to be easily editable by the client. Ideally, the schedule is just a text file ...
1
vote
0answers
25 views

Cron Daemon Missing

I am scheduling scripts in cron and am facing this problem. I try to check if cron daemon is running with service crond status and it returns Missing SERVICE_URI environment variable What does it ...
0
votes
0answers
20 views

How to kill a process from Cron

Usually I do like this: kill -9 $(ps aux|grep Firefox|awk '{print($2)}') But when I try following via cron, it does nothing. 50 * * * * kill -9 $(ps aux|grep Firefox|awk '{print($2)}') Mind you the ...
0
votes
1answer
60 views

Running xprop in a crontab: “unable to open display”

I've just made a perfectly working Bash script that runs xprop(by a regular user and root): #!/bin/bash # time tracking BASH script # current time and date current_date=$(date --rfc-3339='seconds') ...
0
votes
1answer
112 views

Cron: Run every day except first day of the month and first day of each week

I'm fairly new to cron and I'm trying to figure out a way to run a job every day of the week, except for the first day of each month and the first day of each week. This may sound a little odd, but ...
0
votes
1answer
24 views

A clean way to set a daily running time for a program

Kind of a noob question but I'm looking to have my networking daemon (wicd), run every day on my machine, only from 5am-6am and 6pm-7pm, regardless of when my machine was turned on, in other words, if ...
0
votes
0answers
12 views

How to do a Cron.d permission review to ensure sensitive files and directories are secured?

Did an extraction for Linux system audit and is quite confused over the results. If I want to review the cron.d which line should i really be looking at? /etc/cron.d: total 20 drwxr-xr-x. 2 root ...
0
votes
1answer
42 views

CRON job autostart validation

DDNS update is performed from the script duck.sh: chmod 700 duck.sh Open the crontab editor crontab -e A cron process runs the script at 5 minute intervals */5 * * * * ~/duckdns/duck.sh >/dev/...
1
vote
1answer
48 views

Bash condition that won't run on first Thursday of the month

I have a cron that runs a script twice a week (Monday/Thursday) - this runs fine, but I need to stop it processing on the first Thursday of the month. I'd like to adapt this code: we=$(LC_TIME=C ...
0
votes
0answers
22 views

rclone to Google Drive: sync to the top level of Drive?

I've discovered rclone as a way to emulate (mostly) what Google Backup & Sync does on a W10 OS, combined with a cron job setup. So at the moment I'm experimenting with the Drive of a Google email ...
59
votes
2answers
9k views

Suspicious crontab entry running 'xribfa4' every 15 minutes

I wanted to add something to my root crontab file on my Raspberry Pi, and found an entry that seems suspicious to me, searching for parts of it on Google turned up nothing. Crontab entry: */15 * * * ...