Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next version: simplify down and use .s3cfg #9

Open
nickbreen opened this issue Apr 1, 2016 · 2 comments
Open

Next version: simplify down and use .s3cfg #9

nickbreen opened this issue Apr 1, 2016 · 2 comments

Comments

@nickbreen
Copy link
Owner

It's easier to just use .s3cfg rather than fiddling with all the env vars.

E.g. this actually works!

  environment:
    S3_CFG: |
      [default]
      access_key = XXXX
      secret_key = XXXX
      bucket_location = ap-southeast-2
      default_mime_type = application/x-gzip
    CRON_D_BACKUP: |
      @reboot root ln -s /etc/container_environment/S3_CFG /root/.s3cfg

      @daily root (tar cz --verbose /var/www/wp-content/uploads | /usr/local/bin/s3cmd --verbose put - $$(cat /etc/container_environment/BUCKET)uploads.tar.gz) 2>&1 | logger --tag uploads

      @daily root (/usr/bin/mysqldump -uwordpress -pwordpress -hdb -B wordpress | gzip | /usr/local/bin/s3cmd --verbose put - $$(cat /etc/container_environment/BUCKET)db.tar.gz) 2>&1 | logger --tag db

There's a @reboot job that sets up the user's .s3cfg file, which all the other jobs use.

This allows for far simpler cron job spec's and permits trivial specification of arbitrary jobs and arguments.

@nickbreen
Copy link
Owner Author

/backup.sh and /restore.sh can just be refactored to use command line arguments as well as environment variables to make them useful in this situation.

@nickbreen
Copy link
Owner Author

Also, rely on S3 versioning rather than timestamping filenames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant