1
vote
1answer
58 views

When cron is completed How to get email notification and log in a file (both)

I am a Newbie to linux. I'm trying to figure out things. Can someone kindly help me how to combine these two commands? (1) Normally cron can results can be directed to a log file by editing crontab ...
0
votes
1answer
304 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/ ...
0
votes
2answers
48 views

how to prevent crontab logs from registring in syslog?

I have separate my crontab log into cron.log file by uncommenting the below ling in /etc/syslog.conf, But it register in syslog too. cron.* /var/log/cron.log How ...
0
votes
0answers
37 views

Include executed cron command when outputting to log

Is there a way I can include the command in the output when I'm logging to a file? For example * * * * * date && /path/to/php /path/to/script.php >> cron.log 2>&1 Would give ...
1
vote
1answer
302 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" ...
1
vote
0answers
67 views

Rotate svnserve logs; HUP needed?

I have SVN running on CentOS Linux 6.4 with svnserve and pass --log-file=/var/log/svn.log in the config file. This log is very large now and I need to start rotating it. I figure to add it to ...
1
vote
1answer
158 views

cron create output file only if there is output

I have a cronjob that calls a script. I want the output to be placed in a log file. The problem is that the log-file is created even if there is no output. Since the job runs once an hour, and ...
1
vote
2answers
98 views

Redirect output from cron in real time, not after program has finished?

I have a ruby script that writes to STDOUT and sometimes STDERR. I am running this script every 5 minutes via a crontab: */5 * * * * /root/myscript.rb >> /var/log/myscript.log 2>&1 What ...
0
votes
1answer
66 views

Cron job: stdout to /var/log, stderr to email

I have a cron job that is running every hour, and providing output (over stdout) similar to the following: Found 1 batch jobs {'job': 'update'} Job 1 started at 2013-06-07 13:00:03.673683+00:00 ...
0
votes
2answers
475 views

centos cron logs are not executed

I have been trying to setup a cronjob on centos but doesn't seems to work. I have been deleting the crons logfile to see all newly created logs and I have been restarting crond but /var/log/conf ...
0
votes
1answer
253 views

Review of a crontab script to add timestamps to minutely runs; any suggestions?

I've got a crontab job set to run minutely as such: * * * * * /home/username/public_html/domain.tld/production/scripts/cron_runner.sh My goal is to add some timestamps to output from cron so I can ...
2
votes
1answer
449 views

logrotate cron job not rotating certain logs

I added two scripts in "logrotate.d" directory for my application logs to be rotated. This is the config for one of them: <myLogFilePath> { compress copytruncate delaycompress dateext ...
0
votes
1answer
4k views

CRON opens and closes sessions continuously

I'm seeing a huge amount of these lines in my auth logs: Dec 31 03:45:01 xxxxxxx CRON[17259]: pam_unix(cron:session): session opened for user root by (uid=0) Dec 31 03:45:01 xxxxxxx CRON[17259]: ...
3
votes
3answers
308 views

Setting up logging for a remote backup script

So I wrote up a short script that I am planning to run via a cron job daily to package up my site files and send them to a remote location. I also plan to incorporate DB dumps, but I have not gotten ...
1
vote
4answers
555 views

Make cron log rsync only if there was transfer

I have this crontab running every 5 minutes: date >> ~/18/rsync.log rsync -vaz user@r18:~/assets ~/18 >> ~/18/rsync.log 2>&1 It adds this to the log file every 5 minutes: Thu ...
1
vote
1answer
208 views

How to prefix logs with date and time

How to prefix all logs with date time before they are written to the log file? Let's say I am logging unexpected errors in crontab in the following way: python somescript.py >> /tmp/output.log ...
0
votes
2answers
244 views

How can I prevent cron from filling up my root partition?

I'm using cron tasks every 3 mins, the result is logged in my cron.log. Also after executing (wget) certain php file, it's name (with 0 bytes filesize) is copied to root, spaming it - see the figure ...
1
vote
1answer
3k views

How do you set a DATE variable to use in a log for crontab output?

I was playing aroudn with some variations of date like DATE = $(date) but that didnt work either crontab -e CRONLOG=/tmp/log/crontab.log DATEVAR=`date +20\%y\%m\%d_\%H\%M\%S` * * * * * echo ...
0
votes
4answers
553 views

Does Nagios offer a “event logging” dashboard, if not, what should I use to monitor events?

I am using Nagios to monitor that a certain number of servers and processes stay online. This works well and I'm happy with it. However, I would like a consolidated "event log" across the servers ...
0
votes
5answers
437 views

How to record time taken by a cron to execute.

I have a cron set to run every minute * * * * * /usr/php /my/location/script.php Now, I use time function to measure script execution time. So, running console$ time /usr/php ...
2
votes
4answers
155 views

New log entry -> mail notification

I am looking for a script ( bash / perl / python ) which uppon calling by cron every 5 seconds it will check if new lines were added to my specific log files. If there are any new lines, the script ...
1
vote
1answer
53 views

detect whether script was launched by user or via cron

Is there a simple way to determine whether a shell script was initiated via cron or manually by the user? In my case, I want the script to send output to a log file when run via cron, but to stdout ...
2
votes
2answers
659 views

save crontab output to a new file everytime?

I want to save my crontab output: 15 * * * * myscript.sh > ~/logs/log1.txt How do i make the crontab save to a new file everytime (i.e. log2.txt, log3.txt etc.) , instead of updating or ...
1
vote
1answer
1k views

Crontab : is there any log with begin and end time?

I have a lot of crontask on my linux servers for our applications. But I don't find any way to know when a task end, and how long it run. Must I add a soft like time command to log this? Is there any ...
0
votes
1answer
620 views

vi.recover/update command appears every minute in cron log. (POSSIBLE VIRUS)

UPDATE (7th Dec 2010) & WARNING: I copied the files discussed below (from the /var/tmp/vi.recover directory) to my Windows PC and sacnned with ESET NOD 32. It identifed two of the file (sshd: and ...
9
votes
2answers
5k views

Better logging for cronjobs? Send cron output to syslog?

I am looking for a better way to log cronjobs. Most cronjobs tend to spam email or the console, get ignored, or create yet another logfile. In this case, I have a Nagios NSCA script which sends data ...
2
votes
3answers
147 views

Cron job unified logging

I have a series of cron jobs on a server machine. I know I can redirect their stdout/stderr output to a file. If I redirect several cronjob outputs to the same file, will that work even if some of the ...
3
votes
1answer
1k views

Why are cron jobs appearing in logcheck reports?

I've just installed logcheck and configured it to send mail to me whenever it finds problems. It runs every hour by default at HH:02 and is mailing me stuff like this: Jan 31 20:05:01 Linux ...
3
votes
3answers
2k views

Is there any way to exclude specific entries from Linux log files?

Specifically, I'm trying to keep a nice clean cron.log under Ubuntu Server (hardy LTS). In addition to the 4 or 5 cron jobs that come pre-installed, I've added 4 of my own jobs (using the cron.d ...