I want to run
- a shell script
restore - as postgres user
- from php script (the user name is
php) - using sudo
the script will have few lines of code, something like
dropdb <database name>
psql -c "create database <database name> with encoding 'unicode';" -U edutemplate1
psql -d <database name> -f edu.hourly.sql
- what would be the sudo command syntax to run the script
restore - what would be the sudoers syntax to allow php user to run
restorescript aspostgresuser?