{"id":28254681,"url":"https://github.com/bericp1/bitnami-wp-backup","last_synced_at":"2026-04-30T19:32:05.924Z","repository":{"id":74376263,"uuid":"228669621","full_name":"bericp1/bitnami-wp-backup","owner":"bericp1","description":"Backup scripts for a bitnami WordPress instance","archived":false,"fork":false,"pushed_at":"2019-12-18T22:41:15.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-16T04:33:03.804Z","etag":null,"topics":["backups","bitnami","s3","wordpress"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bericp1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-17T17:38:33.000Z","updated_at":"2022-08-09T12:07:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3f2ed9e-8006-4125-a8cb-b38862d08639","html_url":"https://github.com/bericp1/bitnami-wp-backup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bericp1/bitnami-wp-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bericp1%2Fbitnami-wp-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bericp1%2Fbitnami-wp-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bericp1%2Fbitnami-wp-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bericp1%2Fbitnami-wp-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bericp1","download_url":"https://codeload.github.com/bericp1/bitnami-wp-backup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bericp1%2Fbitnami-wp-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32475192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backups","bitnami","s3","wordpress"],"created_at":"2025-05-19T19:23:07.685Z","updated_at":"2026-04-30T19:32:05.918Z","avatar_url":"https://github.com/bericp1.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitnami WP Backup Scripts\n\nA backup script that can be run on a [Bitnami WordPress server](https://bitnami.com/stack/wordpress) to backup the\ndefault WordPress install (database and files), optionally to AWS S3.\n\n## Prerequisites\n\n-   If you want to backup to S3, ensure the `aws` CLI is installed: `sudo apt install awscli`\n-   [`wp`](https://developer.wordpress.org/cli/) which is installed by default on bitnami instances.\n\n## Setup\n\n### Step 1: Clone and place this repository\n\n1.  SSH into your Bitnami WordPress server as the `bitnami` user\n2.  `cd /opt`\n3.  `sudo git clone https://github.com/bericp1/bitnami-wp-backup.git wp-backup`\n4.  `cd wp-backup/`\n5.  `sudo mkdir logs`\n6.  `sudo chown -R bitnami:bitnami .`\n7.  `sudo chmod +x *.sh`\n\n### Step 2 (Optional): Set up S3 backups\n\n1.  Create an S3 bucket with no public permissions\n2.  Create an IAM user with read/write access to that bucket, this policy should work (replace `bucket-name` with the\n    name of your bucket):\n    ```json\n    {\n        \"Version\": \"2012-10-17\",\n        \"Statement\": [\n            {\n                \"Sid\": \"AllowAllReadWriteObjectActions\",\n                \"Effect\": \"Allow\",\n                \"Action\": [\n                    \"s3:AbortMultipartUpload\",\n                    \"s3:DeleteObject\",\n                    \"s3:GetBucketAcl\",\n                    \"s3:GetBucketLocation\",\n                    \"s3:GetBucketPolicy\",\n                    \"s3:GetObject\",\n                    \"s3:GetObjectAcl\",\n                    \"s3:ListBucket\",\n                    \"s3:ListBucketMultipartUploads\",\n                    \"s3:ListMultipartUploadParts\",\n                    \"s3:PutObject\",\n                    \"s3:PutObjectAcl\"\n                ],\n                \"Resource\": [\n                    \"arn:aws:s3:::bucket-name/*\"\n                ]\n            },\n            {\n                \"Sid\": \"AllowRootAndHomeListingOfBucket\",\n                \"Action\": [\n                    \"s3:ListBucket\"\n                ],\n                \"Effect\": \"Allow\",\n                \"Resource\": [\n                    \"arn:aws:s3:::bucket-name\"\n                ],\n                \"Condition\": {\n                    \"StringLike\": {\n                        \"s3:prefix\": [\n                            \"*\"\n                        ]\n                    }\n                }\n            }\n        ]\n    }\n    ```\n3.  Place the IAM user's credentials in `/opt/wp-backup/s3creds.sh` (in the double quotes, replacing\n    `YOUR_ACCESS_KEY_HERE` and `YOUR_SECRET_ACCESS_KEY_HERE`):\n    ```shell script\n    export AWS_ACCESS_KEY_ID=\"YOUR_ACCESS_KEY_HERE\"\n    export AWS_SECRET_ACCESS_KEY=\"YOUR_SECRET_ACCESS_KEY_HERE\"\n    ```\n4.  Change the permissions appropriately:\n    ```shell script\n    chown bitnami:bitnami /opt/wp-backup/s3creds.sh \u0026\u0026 chmod 700 /opt/wp-backup/s3creds.sh\n    ```\n\n### Step 3: Test the script\n\nIf you are backing up to an S3 bucket, run (replacing `bucket-name` with the name of your bucket from above):\n\n```shell script\nsource /opt/wp-backup/s3creds.sh \u0026\u0026 /opt/wp-backup/backup.sh \"auto\" \"auto\" \"bucket-name\"\n```\n\nOtherwise simply run:\n\n```shell script\n/opt/wp-backup/backup.sh\n```\n\nIf an error occurs troubleshoot and fix it before continuing.\n\nYou may also want to test the cleanup script which deletes old backups\n\n```shell script\n /opt/wp-backup/cleanup.sh\n```\n\n### Step 4: Schedule the scripts to run daily\n\nThese cron jobs will log all output to `/opt/wp-backup/logs/`.\n\n1.  `sudo crontab -e -u bitnami` (select an editor if this is your first time running this script, nano is the easiest)\n2.  Add the following 2 lines to schedule backups for 7:30 AM UTC and cleanups for 8:30 AM UTC:\n    \n    If you're using S3 (replace `bucket-name` with the name of your bucket from above):\n    \n    ```text\n    30 7 * * * . /opt/bitnami/scripts/setenv.sh; . /opt/wp-backup/s3creds.sh; /opt/wp-backup/backup.sh \"auto\" \"auto\" \"bucket-name\" \u003e\u003e \"/opt/wp-backup/logs/cron-backup-`date -u +\\%s`.txt\" 2\u003e\u00261\n    30 8 * * * . /opt/bitnami/scripts/setenv.sh; . /opt/wp-backup/s3creds.sh; /opt/wp-backup/cleanup.sh \u003e\u003e \"/opt/wp-backup/logs/cron-cleanup-`date -u +\\%s`.txt\" 2\u003e\u00261\n    ```\n    \n    Otherwise:\n    \n    ```text\n    30 7 * * * . /opt/bitnami/scripts/setenv.sh; /opt/wp-backup/backup.sh \u003e\u003e \"/opt/wp-backup/logs/cron-backup-`date -u +\\%s`.txt\" 2\u003e\u00261\n    30 8 * * * . /opt/bitnami/scripts/setenv.sh; /opt/wp-backup/cleanup.sh \u003e\u003e \"/opt/wp-backup/logs/cron-cleanup-`date -u +\\%s`.txt\" 2\u003e\u00261\n    ```\n\n## Manual / Advanced Usage\n\n### `backup.sh [wp-root] [site-name] [s3-bucket]`\n\nBacks up a WordPress install.\n\nIf `wp-root` is not provided or is literally `\"auto\"`, we will use the global `wp` command to determine where the\nWordPress install is. This works on bitnami's WordPress stack by default since the global `wp` command is automatically\npreconfigured to point to the default WordPress install hosted in `/opt/bitnami/apps/wordpress/htdocs`. You can specify\na root explicitly if needed using this parameter to override this.\n\n`site-name` is used in the names of the backup files and folders. It must be a sanitized string that's safe to be used\nin the names of files and folders. If `site-name` is not provided or is literally `\"auto\"`, we will use the global `wp`\ncommand to generate a site name slug using the following PHP:\n\n```php\necho sanitize_title(get_bloginfo(\"name\"));\n```\n\nIf `s3-bucket` is provided, the backup will also be stored in s3 in the specified bucket. Ensure the\n`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables are set in order for the `aws` CLI to\nauthenticate. The backup script will bail out early if we're unable to write to the backup destination within the\nbucket.\n\n### `cleanup.sh`\n\nCleans up old local backups. Right now this is not configurable and it will always remove any backup anywhere in\n`/opt/wp-backup/backups` that hasn't been modified in 1 week.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbericp1%2Fbitnami-wp-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbericp1%2Fbitnami-wp-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbericp1%2Fbitnami-wp-backup/lists"}