On 11/23/2015 04:33 PM, anj patnaik wrote:
I am seeing a bizarre behavior. The command works fine when called
directly from prompt, but when invoked via cron, there is no output nor
mail.
This works fine:
script 2>&1 | tee /tmp/ff ; mailx -s "email" -myem...@company.com
I am seeing a bizarre behavior. The command works fine when called directly
from prompt, but when invoked via cron, there is no output nor mail.
This works fine:
script 2>&1 | tee /tmp/ff ; mailx -s "email" -myem...@company.com < /tmp/ff
Now, I place the identical line in crontab file and the
I have a cron script that does the following:
PGPASSWORD=$PGPASSWORD /opt/PostgreSQL/9.4/bin/pg_dump -t RECORDER -Fc $i
-U postgres -Z0 | xz -9 > "$backup_dir/$i-$timeslot-database"
xzcat "$backup_dir/$i-$timeslot-database" |
/opt/PostgreSQL/9.4/bin/pg_restore -h $backupHost -U postgres -d
On Fri, Nov 20, 2015 at 5:09 PM, anj patnaik wrote:
> 0 20 * * * db_backup.sh 1> /dev/null 2>&1 | mail -s "backup cron"
> myem...@comp.com
>
> I am re-directing stderr to stdout and then sending that to email.
But you are redirecting stdout (and therefore also stderr) to
anj patnaik writes:
> My cron tab entry:
> 0 20 * * * db_backup.sh 1> /dev/null 2>&1 | mail -s "backup cron"
> myem...@comp.com
> I am re-directing stderr to stdout and then sending that to email.
Uh, read it again: you're redirecting stdout to /dev/null and then
redirecting
You could also try tweaking the following attached backup script.
Caution, I wrote this quickly from a skeleton script and has not been
tested.
On Mon, Nov 23, 2015 at 3:21 PM, Tom Lane wrote:
> anj patnaik writes:
> > My cron tab entry:
>
> > 0 20 * * *
On 11/23/2015 12:21 PM, Tom Lane wrote:
>0 20 * * * db_backup.sh 1> /dev/null 2>&1 | mail -s "backup cron"
>myem...@comp.com
>I am re-directing stderr to stdout and then sending that to email.
Uh, read it again: you're redirecting stdout to /dev/null and then
redirecting stderr to go where