Crontab keeps saving empty files of the job file.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab keeps saving empty files of the job file.
# 1  
Old 10-20-2008
Crontab keeps saving empty files of the job file.

Hey,

Code:
MAILTO=cron@domain.ca
*/20 * * * * /usr/bin/wget http://list.domain.ca/admin/consume.php >/dev/null

thats what the crontab is setup todo, so basically every 20minutes it runs consume.php

In my root directory, i'm getting files like this:
consume.php
consume.php1
consume.php2
i woke up this morning with 24emails and consume.php1 - consume.php24

can someone please tell me why it's doing this and/or how to stop it.

Email output:

--15:00:01-- http://list.domain.ca/admin/consume.php
=> `consume.php'
Resolving list.domain.ca... 74.208.60.144
Connecting to list.domain.ca|74.208.60.144|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

0K 0.00 B/s

15:00:01 (0.00 B/s) - `consume.php' saved
# 2  
Old 10-20-2008
Code:
MAILTO=cron@domain.ca
*/20 * * * * /usr/bin/wget http://list.domain.ca/admin/consume.php >/dev/null

should be

Code:
MAILTO=cron@domain.ca
*/20 * * * * /usr/bin/wget http://list.domain.ca/admin/consume.php 2>&1 /dev/null

if you don't want to get emails. (The change is in the 2>&1, in case it is not obvious what I changed.)

Regards.
# 3  
Old 10-20-2008
New email output below, it still keeps emailing me and saving consume.php1
--17:14:01-- http://list.domain.ca/admin/consume.php
=> `consume.php'
Resolving list.domain.ca... 74.208.60.144
Connecting to list.domain.ca|74.208.60.144|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

0K 0.00 B/s

17:14:01 (0.00 B/s) - `consume.php' saved [0]

/dev/null: Unsupported scheme.

FINISHED --17:14:01--
Downloaded: 0 bytes in 1 files
# 4  
Old 10-20-2008
If you don't want wget to save the returned html message form consume.php, direct the output file to /dev/null:
Code:
-O /dev/null

You can add a -q flag to have wget suppress output information as well, that way you don't need the 2>&1 /dev/null part (so you'll get sent genuine issues but not regular runs).
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Saving files with file name as output

Hi, i need help with a file creation of an output program. I've got a program that with #find creates an output for each files in a directory. If i give this command : -o spec$(date -u +%Y%m%dt%H%M) it creates just one file, overwriting all the others since it is the creation date .... (2 Replies)
Discussion started by: Board27
2 Replies

2. Shell Programming and Scripting

Check file from multiple files is empty using awk

I am passing multiple files in awk & since one of the file is empty(say file3) so the same gets skipped & logic goes for toss. Need suggestion/help in checking and putting additional checks for the same awk -F, 'FNR==1 {++filecounter} filecounter==1 {KRL=$2;next} filecounter==2... (8 Replies)
Discussion started by: siramitsharma
8 Replies

3. Shell Programming and Scripting

Create empty files from a list on file

Hello Guys. Please I would like to create empty files from a list In file1 will be the followin values, so i will like to create for each name a empty file. file1 2191off-r0.sps 2192off-r0.sps 2193off-r0.sps 2194off-r0.sps 2195off-r0.sps So I need to get 5 empty files. Thanks for... (7 Replies)
Discussion started by: jiam912
7 Replies

4. Shell Programming and Scripting

Crontab Job Output File

I am a newbie to Unix. My default root user umask is set to 077 and I have the following crontab job to redirect al the backup output to the logfile of /backup/backup.xxxxx 00 10 * * 0 /usr/local/bin/backup.sh > /backup/backup.`date +\%Y\%m\%d` 2>&1 Since root default umask is 077, the... (2 Replies)
Discussion started by: famasutika
2 Replies

5. Shell Programming and Scripting

Shell Script to grep Job File name and Log File name from crontab -l

Hello, I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l. #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1 #40 17 * * * /home/oracle/refresh/refresh_ux634.sh... (1 Reply)
Discussion started by: guptra
1 Replies

6. Shell Programming and Scripting

parsing txt file, saving graphics files

hi everyone, i am a newbie in shell programming. and i want to simply go through a text file that contains 3 "columns", split by ';' customerID ; link-to-contract ; save-as-filename so an example would simply look like this now i want to loop through every line, and save the file from... (3 Replies)
Discussion started by: Confidence
3 Replies

7. UNIX for Dummies Questions & Answers

Assistance with combining, sorting and saving multi files into one new file

Good morning. I have a piece of code that is currently taking multiple files and using the CAT.exe command to combine into one file that is then sorted in reverse order based on the 3rd field of the file, then displayed on screen. I am trying to change this so that the files are being combined into... (4 Replies)
Discussion started by: jaacmmason
4 Replies

8. Shell Programming and Scripting

Replace all found files with an empty file?

Hi all, I need to replace certain robots.txt files with an empty file. I use the following to find the files I want to empty out: find /Sites -type f -name "robots.txt" -exec grep -il "STAGE" {} \; (finds all robots.txt files which contain the string 'STAGE') Now what do I add to this... (3 Replies)
Discussion started by: Evert
3 Replies

9. Shell Programming and Scripting

empty crontab

how to create empty crontab using shell script? (7 Replies)
Discussion started by: crackthehit007
7 Replies

10. UNIX for Dummies Questions & Answers

CRON Job - saving to a different server?

Thanks for the all the help last evening on CRON jobs. It's now working. Is it possible with cron to save a backup of a file to a different server or location? The idea being that if one host goes arse over tit, I'll have a backup of the DB on another server? Many thanks, Ed Ludlow (3 Replies)
Discussion started by: eludlow
3 Replies
Login or Register to Ask a Question