Jason Long <mailing.list@xxxxxxxxxxxxxxxxxxxxx> writes: > I am working on archiving my WAL files. For now I am just mailing > myself a list of the directory contents using the following script. > *-rwxr-xr-x 1 postgres postgres 87 Oct 28 20:23 > /var/lib/pgsql/mail-WAL-list.sh* > I can run this when logged on as postgres and the cron runs fine as > well, but I keep seeing the following in my logs. > *LOG: archive command failed with exit code 126 > DETAIL: The failed archive command was: /var/lib/pgsql/mail-WAL-list.sh > WARNING: transaction log file "0000000100000000000000F0" could not be > archived: too many failures > sh: /var/lib/pgsql/mail-WAL-list.sh: Permission denied* That's just bizarre. The permissions on the script itself seem to be fine, so the only theory that comes to mind is the server doesn't have search (x) permission on one of the containing directory levels ... but that's hard to believe seeing that your data directory is inside the same tree. [ thinks... ] I believe that some flavors of Unix are picky about shell scripts having a proper introducer line. I'm not sure that would manifest as "Permission denied", but does it work better if you put "#! /bin/sh" as the first line of the script file? regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general