0
votes
0answers
27 views

Cron bash script skips second do/done set

I have a script that checks IPs for ping reply then tries to run an snmpwalk on them. I am trying to schedule the script to run weekly in cron. When I run the script in the shell, it runs perfectly. ...
0
votes
1answer
21 views

Sending cron output as a text file attachment

I sysadmin a multiplayer game at CentOS 6.5 Linux server for a customer. The customer has requested me to send the daily chat logs (to identify and ban agressive players) - as a text file ...
2
votes
1answer
58 views

Should I use cron.hourly or crontab?

It seems that all the suggestions for using/scheduling awstats is via crontab, as such: 0 * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=mysite -update >/dev/null (running awstats ...
0
votes
0answers
36 views

alternatives, sudo and crontab problems [migrated]

On an Ubuntu 12.04 machine I've used the alternatives system to set the editor to vim.basic. I get the correct editor when root but not when I sudo to root and run crontab, and I'm trying to ...
-1
votes
0answers
17 views

trigger an email when some user edit crontab in the PC

Is there any way to trigger an email when some user edit crontab in the PC ? i.e my crontab contains several cron jobs which scheduled to run daily. i need to trigger an email when some one add or ...
-2
votes
2answers
67 views

Cron not launching python script

Python script is not being run, all other functions are running and stand alone script runs but combined... nada. Initially it was */30 * * * * screen python ~/db_preset.py (Yes there was new line ...
1
vote
1answer
34 views

crontab truncates file path

I try to run the following command: crontab -u root /root/iss/current/node/bin/installers/nl_brandless_selector_full_hd/nl_brandless_selector_full_hd_cron_file But I got an error like this: ...
-2
votes
1answer
51 views

Crontab not working to send email [closed]

I have CentOs 6.5 running on a VPS Host. I installed crontab and email using the below commands yum install vixie-cron service start crond chkconfig crond --levels 235 on yum install sendmail ...
0
votes
0answers
22 views

Crond stopped sending e-mails for no apparent reason [duplicate]

I have a cron job that I want to run just once a day (executes a rake task), but while I'm testing it I have it set to run every 5 minutes. It was running perfectly fine this morning and sending me ...
0
votes
1answer
26 views

Spam emails from Suse server: test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp

Have a virtual server with old Suse. About a month ago cron started spamming me with emails like this: Subject: test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp ...
0
votes
1answer
65 views

Problems with a PHP include from the command line (or cronjob) [closed]

I am trying to setup a cronjob on my AWS EC2 instance. There is nothing wrong with the actual entry in the crontab file but when I try to run the command in the command line I get this response. PHP ...
0
votes
1answer
78 views

How to make sure script is always running?

I have 4 scripts in crontab that start on server boot. After 12 hours or so, some throw an exception and stop running. At that point, I want my server to just start the script again, so each script is ...
0
votes
1answer
48 views

Binding timestamp value to a variable in crontab

I'm basically trying to declare a variable with a date() value in crontab as I will constantly be using the same date structure over and over, here is what my crontab looks like so far. php = ...
0
votes
0answers
107 views

Is it better to use the systemd service unit's Restart & RestartSec, or use a systemd timer unit?

I have a couple of in-house automated scripts running at periodic intervals. One is every five minutes, the other is every minute. They don't really need to be ran on-the-dot; e.g. I don't care if ...
0
votes
1answer
163 views

ways to automatically fix line endings in shell scripts or files who break with ^M

Problem We regularly break our files lines endings and things stop working without us noticing. Bash complains about "invalid option" or ": command not found" as described here: ...
0
votes
1answer
78 views

How to get atop to create daily logfile

I'm running a website on a VPS running Centos 6.5 and am having some issues. I'm new to serveradmin so just learning. atop was already installed on our machine and it's working. I wanted to go in and ...
1
vote
1answer
505 views

Capturing output from a remotely executed command via SSH fails in CRON

This question is in a direct relation to this one: ssh fails to execute remote command when run from cron bash script - works from CLI I'm not able to comment on the accepted answer as I don't have ...
1
vote
1answer
56 views

Difference between “crontab -e” & editing crontab file manually? [duplicate]

I noticed some people use "crontab -l" to view cronjobs and "crontab -e" to edit them. However there are also times where people manually modify "/etc/crontab" to view/add/remove cronjobs. Both ...
3
votes
1answer
58 views

Crontab - Unusual config - Skip a small weekly time window

I have a business requirement to run an unorthodox crontab schedule as follows: Everyday run a script from 1-21 Everyday but saturday, run from 21-0 So I was thinking this would work: 5 1-20 ...
-2
votes
1answer
113 views

Bash and cron error [duplicate]

The following cron job fails to execute. What's wrong with it? It works fine when I run it directly from the shell prompt. www-data@etl:~$ crontab -l SHELL=/bin/bash MAITO="" 0 5 * * * export ...
1
vote
3answers
102 views

crontab cannot find script

I have a cron job that runs under my user once per night. I installed it using crontab -e and a by adding the line: 0 1 * * * /home/username/diskreport.sh The crontab is set up so that ...
2
votes
1answer
78 views

Disable mailing in cron globaly

The web is full of suggestions how to disable mailing in cron like asked here stop linux from emailing me cron errors?. Is there really no global config flag I can set to disable mailing in cron for ...
0
votes
1answer
443 views

Compress and remove logs from jboss on linux with cron

I need to compress and remove log files after some time from serwer. I have never write scripts before. So far i have script logs.sh: #!/bin/bash LOGS=/usr/local/jboss/server/default/log/ ...
1
vote
2answers
474 views

Linux Bash IF conditions not processing when running as crontab

So I've made myself a little script which monitors my served directories for any PHP files which have changed. It's designed to run every 5 mins from crontab and email me any changes so that I can ...
0
votes
0answers
51 views

Postfix/Dovecot Service

I have installed Postfix 2.10.2/Dovecot 2.2.5 on RHEL 5.9 from a source code, I forced Installation to be in my own directories not Defaults, I need to add Postfix/Dovecot under services or init.d to ...
2
votes
1answer
55 views

CRON job running but no sign of it in any file

This is an odd one and I know that the answer will be something simple that I have over looked... I have inherited responsibility for a Linux server running an old version of Ubuntu 10.04, it has a ...
1
vote
1answer
148 views

One-line backup, compress, scp database file

I support a company with a remotely hosted web site. They use PostgreSQL dbs. I can't write scripts on the remote server, and I don't want to store any backup files on the remote server, but I can ...
-1
votes
1answer
130 views

Restart crontab @reboot rule without actual reboot

I'm using crontab with a @reboot entry which starts a script containing a endless while-loop that is processing the output of a tail -F command. Is there any way to stop the currently running script ...
-1
votes
1answer
64 views

Configuring / Securing credentials required by batch job

I have a batch job which should run as cron job on a Linux server. This job requires some credentials to do it's work. Idealy I don't want to have that kind of credentials stored on my server, but ...
0
votes
1answer
403 views

Cron won't use msmtp to send emails in case of failed cronjob

I'm trying to configure a machine so that it will send me an email if one of the cronjobs output something in case of an error. I'm using Debian Wheezy. Cron is working normally (without the email ...
2
votes
1answer
117 views

Why is cron mailing me program output even though I've redirected to /dev/null?

I'm trying to restart a system process through cron and getting emailed the startup output of the process. I thought redirecting STDOUT and SDTERR to /dev/null would "silence" the output but alas, ...
0
votes
0answers
41 views

need at jobs identified by name (advanced atd daemon)

Sometimes I'd like to delete or overwrite (or simply cat) an at job. Unfortunately, the at jobs are identified by a sequential number (file in /var/spool/cron/atjobs), which makes those operations ...
2
votes
1answer
645 views

Crontab maximum command length

Is there a limit of characters a command in a crontab could be ? I have a crontab with a 178 characters command and it seems to be truncated at 164 when executed. I can tell this number from the ...
4
votes
1answer
142 views

Why is crontab file periodically overwritten?

I have a Ubuntu 12.10 server with an nginx user that I use to edit a crontab file. Periodically (maybe once every few hours? it's hard to tell), I notice that edits I have made as the nginx user have ...
-1
votes
2answers
127 views

running a cron job on a time interval [duplicate]

Is it possible to run a job for 2 hours at a specific time? So lets say I want to run wget command that calls/hits an endpoint in my web app for 2 consecutive hours in a day. Meaning that every single ...
1
vote
1answer
30 views

Cron: where is the /etc/cron.d defined? Is it possible to add a new directory?

In CentOS, where is the /etc/cron.d folder defined? Is it possible to add a new folder that works exactly as it? Example: I have another folder ( /mnt/software/cron ) full of files with the exact ...
1
vote
3answers
1k views

How can I run a Cron job to make backups of a MySQL server by SSH

I have a production server running CentOS with a MySQL database. At home, I have a QNAP NAS (runs a little embed linux). I want to make a Cron job on my NAS to backup the data from my CentOS ...
4
votes
2answers
1k views

Setting timeout for cron jobs

Do Ubuntu Linux cron (Vixie cron?) support setting timeout for its jobs? Specifically, the process would be killed after X seconds unless it finishes successfully by then. I have had some cases ...
-1
votes
3answers
357 views

Are Linux cron Jobs each executed sequentially or in parallel?

Lets say I create two cron jobs: Cron Job A, runs every day at 8:00AM Cron Job B, runs every day at 8:05AM However, Cron Job A, takes 12 hours to run (don't ask why, this is an example). Will ...
-1
votes
1answer
158 views

How can I check cron task it's running? [duplicate]

I put a cron script in /etc/cron.d: [root@node ~]# cat /etc/cron.d/reconfig 0 */6 * * * root /root/bin/reconfig.pl But I get no list of cron tasks for root: [root@node ~]# crontab -l no crontab ...
0
votes
3answers
120 views

script bash can't get difference in $PS1 or $- when running interactivelly or via cron

I want my cron scripts being executed verbosly when run interactively by a system user (for debug purpose for instance) and quietly otherwise (for cron, as I want receive e-mail if and only if I get ...
1
vote
2answers
62 views

Is there a way to source cron jobs from a file

One of our servers has around 20-25 different cron jobs scheduled on it. Usually, we periodically check-in the cron jobs to a file in the repo using crontab -l > cron.jobs While bringing up a new ...
1
vote
1answer
361 views

Strange syslog for my server

Today i go on my log with nano /var/log/syslog I have this, and i think it's not very good : Aug 27 06:25:02 ks3309528 rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="2235" ...
2
votes
2answers
252 views

check if process is running, even under cron

I have a cron job that runs every minute, but if it finds data, might take many minutes to finish. I need to tell if another instance of the script is running from another. To make things even more ...
0
votes
1answer
55 views

Strange crontab behaviour [duplicate]

This evening I have been playing with cron for the first time, and have started experiencing strange results. The script that I am trying to run is a watchdog that allows me to manage a couple other ...
4
votes
1answer
164 views

How can I create cron jobs in specific files on Linux Centos

I want to have a separate folders for cron jobs like: /mydata/cronjobs Now in that folder I want to have files like backup_server which will have the content like: 30 3 * * 1-5 ...
1
vote
2answers
417 views

How to prevent termination of long-running Python script

I have a cron job running a Python script on a VM-based remote Ubuntu server. The script takes a couple hours to run, and I'm noticing the kernel appears to be terminating the script before it ...
6
votes
1answer
486 views

how to execute a command on the first, second, third and fourth Sunday of the month with crontab [duplicate]

I have 4 servers and I want each one of them to execute a reboot on Sunday. Server 1 - first Sunday of the month (first week) Server 2 - Second Sunday of the month (2nd week) Server 3 - third Sunday ...
0
votes
1answer
67 views

what is the meaning of *this* crontab setting?

* */1 * * * sh foo.sh I found this setting on one production machine. And foo.sh was executed every one minute. I am guessing that the original author of this setting wants it to be executed every ...
0
votes
1answer
41 views

Can't locate cron service, how to start it?

# rpm -qa | grep cron crontabs-1.10-5.noarch I have the above version of cron installed on my RHEL 6 server. My crontabs commands aren't reconginzed: # crontabs -l -bash: crontabs: command not ...