crontab
Hi everybody,
I am facing a problem with crontab . When I am trying to redirect the standard output for qshape(for postfix queue) command, file is created but there are no contents in the file. The crontab entry is: Code:
now the file log.txt is created with no contents, However if I run the command Code:
qshape > log.txt I find certain contents in the file. Can anybody help me out? thanks in advance. |
What does this command do exactly?
Try doing: */1 * * * * /usr/bin/qshape >> log.txt |
When I tried
Code:
*/1 * * * * qshape 2> log.txt i.e. redirecting the error. I found Code:
/bin/bash: command not found actually qshape command was located in /usr/sbin/. thanks anyway! |
Quote:
Why did you try it without the full complete path? When dealing with cron and crontab, it's always a good practice to put the full complete path of the command. If it's located in /usr/sbin, perhaps having it /usr/bin was the problem, but I'm just totally confused with your followup, it made no sense to me on if you're still having problems, solved it, etc. |
Hi!!
The problem was very specific to the command , I think. When I type "qshape" on shell I get: Code:
T 5 10 20 40 80 160 320 640 1280 1280+ it shows status of postfix queues. I found my problem solved with the crontab entry : Code:
*/1 * * * * /usr/sbin/qshape -c /etc/postfix /var/spool/postfix/active > /root/log3.txt While typing it on console , it takes these directories by default and in crontab it gives the error. |
Quote:
|
All times are GMT -5. The time now is 11:32 PM. |