I'm putting the finishing touches on my omero installation and ran into a problem setting up my cron jobs. I followed the suggestions for setting up daily postgres backups with the example script:
- Code: Select all
#!/bin/bash
DATE=`date '+%Y-%m-%d_%H:%M:%S-%Z'`
OUTPUT_DIRECTORY=/OMERO/backup/database
DATABASE="omero_database"
DATABASE_ADMIN="postgres"
mkdir -p $OUTPUT_DIRECTORY
chown -R $DATABASE_ADMIN $OUTPUT_DIRECTORY
su $DATABASE_ADMIN -c "pg_dump -Fc -f $OUTPUT_DIRECTORY/$DATABASE.$DATE.pg_dump $DATABASE"
I've set crontab to run this script (located in /home/omero/cron.omero/) as root, but I get the following error when it runs:
- Code: Select all
could not change directory to "/root": Permission denied
I've looked around, but I'm not sure where this error is arising. The permissions of the directory with the script are "drwxr-xr-x omero omero" and the output directory permissions are "drwxrwxr-x postgres omero"
Thanks in advance for any suggestions!
Blair