- type:
- text //
- 2010.Feb.19
- 12.53pm
s3cmd will complain about configs…
s3cmd will complain about configs if you’re running it as a different user than the one you have the configs saved as. Makes sense, right?
The setup
I’ve got a launchctl set up that runs a bash script I’ve done up (with some awesome Internet help, which I think I found on a PostgreSQL community site).
This bash script goes through each PostgreSQL database on the server, zips it up and saves it where you want. I use it as a daily dump of what’s on our server.
The problem and the solution
Since the launchctl was running as root, it didn’t have automatic knowledge of the administrator account’s s3cfg file (which is stored under ~/.s3cfg). It would run, backup the database, but not upload it to S3. Looking under the system logs gave me my answer, as s3cmd was complaining about not finding that config file, which had my S3 secret key and things like that (you know, all the important stuff a connection to S3 would need). Declaring the —config /path/to/.s3cfg argument to s3cmd (as you can see in my updated script above) fixed it.

