>I'm presuming the nsvm_backupdb script works fine when executed manually
>from the command line and that your problem lies within the cfexecute
>implementation.
yup, it was working fine from the command line.
The problem lies in the script itself :P. When the cfexecute calls the script (cfmx user being User apache) , the script didn't execute the way i wanted because a prompt for the postgres password appeared.
Somehow, nimwit me added an unnecessary "su - postgres -c" . Of course, a password would be required to change from a User apache to User postgres just to execute the command.
The correct script is as below:
#!/bin/bash
#File is named according to abbreviation of week name (Sun...Sat)
#e.g. nsvm_Mon_2004.db
backupdate=`date +%a_%Y`
/usr/local/pgsql/bin/pg_dump -U postgres -f /home/apache/nsvm_$backupdate.db nsvm
echo "Manual Backup at `date`: nsvm_backupdate.db">>/home/apache/nsvm_backup_log
done
Thanks for all the help, guys!
warm regards,
siew hui
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
