Shakthi777
asked on
Runing crontab jobs for postgres user ?
Hi Experts,
I need to run some script over my Postgres database by postgres user. So, I have set a cron tab to execute it for every 5 minutes.
script1=the file containing my script
But its not running. I can't root's crontab since it's not allowed in Postgres service.
Can you kindly help me on this and thanks a lot for your time !
I need to run some script over my Postgres database by postgres user. So, I have set a cron tab to execute it for every 5 minutes.
*/5 * * * * /folder/script1 -m srv1:5432 -s srv2:5432 -b /usr/lib/postgresql/9.2/bin
script1=the file containing my script
But its not running. I can't root's crontab since it's not allowed in Postgres service.
Can you kindly help me on this and thanks a lot for your time !
Hi,
maybe this help you:
su postgres -c " your command eq. bash script "
or
sudo su postgres -c "your commend ... "
maybe this help you:
su postgres -c " your command eq. bash script "
or
sudo su postgres -c "your commend ... "
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
tnx !
If yes, maybe you need to add it in your script
PATH="/bin:/sbin:/usr/bin:
/yourscriptlocation;" which is just example only
and it might also need to do " chmod 755 yourscript"
Hope understand your question completely, if not , please point it out
Duncan