{"id":19006068,"url":"https://github.com/alx-xlx/backup-website-to-cloud","last_synced_at":"2025-09-13T13:29:18.615Z","repository":{"id":108340645,"uuid":"307040044","full_name":"alx-xlx/backup-website-to-cloud","owner":"alx-xlx","description":"This is a script to push a backup of your website, forum etc to Cloud Storage using rclone","archived":false,"fork":false,"pushed_at":"2021-03-09T04:42:11.000Z","size":92,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-30T00:45:20.970Z","etag":null,"topics":["backup-script","backup-tool"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alx-xlx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-10-25T06:42:37.000Z","updated_at":"2024-01-28T15:15:57.000Z","dependencies_parsed_at":"2023-05-21T21:45:33.493Z","dependency_job_id":null,"html_url":"https://github.com/alx-xlx/backup-website-to-cloud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alx-xlx%2Fbackup-website-to-cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alx-xlx%2Fbackup-website-to-cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alx-xlx%2Fbackup-website-to-cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alx-xlx%2Fbackup-website-to-cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alx-xlx","download_url":"https://codeload.github.com/alx-xlx/backup-website-to-cloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232121440,"owners_count":18475558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["backup-script","backup-tool"],"created_at":"2024-11-08T18:30:07.465Z","updated_at":"2025-01-01T19:43:57.296Z","avatar_url":"https://github.com/alx-xlx.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- [center]\n![flarum](https://i.imgur.com/bL7WdcT.jpg)\n[/center] --\u003e\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://i.imgur.com/cN9utR1.png\" alt=\"backup forums\" height=\"\"\u003e\n\n\u003c/div\u003e\n\n### This tool will automatically backup any websites, forums etc from your server (e.g Shared Hosting) to your favourite Cloud Storage\n\n# backup-flarum\n This is a script to push a backup of your Flarum Instance to Cloud Storage using rclone\n\nBUT you can use this even for Wordpress and all other forums\n\n## ☁ Cloud Storages\n```\n1Fichier\nAlias for an existing remote\nAmazon Drive\nAmazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)\nBackblaze B2\nBox\nCache a remote\nCitrix Sharefile\nDropbox\nEncryptDecrypt a remote\nFTP Connection\nGoogle Cloud Storage (this is not Google Drive)\nGoogle Drive\nGoogle Photos\nHubic\nIn memory object storage system.\nJottacloud\nKoofr\nLocal Disk\nMail.ru Cloud\nMega\nMicrosoft Azure Blob Storage\nMicrosoft OneDrive\nOpenDrive\nOpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)\nPcloud\nPut.io\nQingCloud Object Storage\nSSH/SFTP Connection\nSugarsync\nTardigrade Decentralized Cloud Storage\nTransparently chunksplit large files\nUnion merges the contents of several upstream fs\nWebdav\nYandex Disk\nhttp Connection\npremiumize.me\nseafile\n```\n[Click Here](https://rclone.org/overview/) to see the list of Cloud Storages we can upload our Backups to\n\n# Make Sure to Create a Backup of your Server before trying\n*2nd last line in script is dangerous if you don't point it to correct directory*\n\n## 📸 Screenshots\n\n![backup-flarum-server](https://raw.githubusercontent.com/alx-xlx/backup-flarum/main/images/backup-flarum-server.png)\n\n![backup-flarum-files](https://raw.githubusercontent.com/alx-xlx/backup-flarum/main/images/backup-flarum-files.png)\n\n![backup-flarum-google-drive](https://raw.githubusercontent.com/alx-xlx/backup-flarum/main/images/backup-flarum-google-drive.png)\n\n\n## Please explain how will this work ?\n\n- a directory with current date and time will be created\n- zipped database \u0026 flarum folder will be stored in the newly created folder\n- we will push this backup to our Cloud\n- and delete the rest of the backups on our server which are older than 2 Days\n\n#### update_backup.sh\n```sh\n# #!/usr/bin/env bash\nNAMEDATE=`date +%F_%H-%M_%s`_`whoami` \u0026\u0026 echo $NAMEDATE\nmkdir ~/flarum_backup/$NAMEDATE -m 0755 \u0026\u0026 echo \"Directory Created\"\nmysqldump -u \u003cDATABASEUSERNAME\u003e -p\"\u003cDATABASEPASSWORD\u003e\" \u003cDATABASENAME\u003e | gzip \u003e ~/flarum_backup/$NAMEDATE/db.sql.gz \u0026\u0026 echo \"Database Dumped\"\ntar czf ~/flarum_backup/$NAMEDATE/files.tar.gz ~/\u003cPATH_TO_FLARUM\u003e \u0026\u0026 echo \"Server Files Dumped\"\nchmod -R 0644 ~/flarum_backup/$NAMEDATE/* \u0026\u0026 echo \"Directory Permission Restored\"\n/home/\u003cHOSTINGUSERNAME\u003e/flarum_backup/rclone copy ~/flarum_backup/$NAMEDATE \"gdrive:Flarum Backup/$NAMEDATE\"\ncd ~/flarum_backup; find . -type d -mtime +2 -exec rm -rf {} \\; 2\u003e\u00261 \u0026\u0026 echo \"Directory older than 2 days Deleted !!\"\nexit 0 \n```\n\n## 🛠 Configuration\n\n### update_backup.sh\n\n- Create a Directory `flarum_backup` on your server (e.g /home/HOSTINGUSERNAME/flarum_backup)\n- Download [rclone](https://rclone.org/downloads/) . (For most it would be rclone Linux x64)\n- unzip the contents of [rclone-v1.xx.x-linux-amd64.zip]\n- copy `rclone` [12 Megabytes] file to our `flarum_backup` directory\n- copy `update_backup.sh` to `flarum_backup` directory and edit the following\n- `\u003cDATABASEUSERNAME\u003e` - database username\n- `\u003cDATABASEPASSWORD\u003e` - database password\n- `\u003cDATABASENAME\u003e` - database name\n- `\u003cHOSTINGUSERNAME\u003e` - run `pwd` in your terminal to get the server username\n- `\u003cPATH_TO_FLARUM\u003e` - Location of your root flarum (This will even backup vendor dir, we will include this as it takes less than 50 megabytes)\n\n\n### rclone\n\nWe will use `Google Drive` as an Example\n\n- Run `./rclone config`\n- Create a New Remote (in our case it is named `gdrive`)\n- Choose `13` to select Google Drive as our Cloud Storage (you can choose other Storages from the list)\n- Select Role `1`\n- Follow the steps, verify your google drive and complete the setup\n- Run `./rclone lsd gdrive:` to see if it is configured correctly. All the folders in `My Drive` will be listed\n\n\nNote: It is recommended to use your own `CLIENT_ID` \u0026 `CLIENT_SECRET`, refer [here](https://github.com/alx-xlx/goindex#get-google-clientid-and-secretid)\n\n## 🖱 Backup Manually\n\nYou can simply open SSH and Run\n\n```sh\nbash update_backup.sh\n```\nOR\n\nYou can run commands individually to see how much resource it takes for each specific task\n\n## 🤖 Automatic/Schedule Backup\n\nIf you have \"Cron Jobs\" service in your c-panel then \n\n```\n0 0 * * * /bin/bash ~/flarum_backup/update_backup.sh \u003e\u003e /home/learjrbj/flarum_backup/update_log 2\u003e\u00261;\n```\n\nThe above cronjob will run the `update_backup.sh` everyday and backup everything to your configured cloud using rclone\n\n*You can also create a python OR nodejs script to automate incase you don't have Cron in your C-PANEL*\n\n## 🔻 Cons\n\n- once While using google drive in rclone, new \"Flarum Backup\" folders were being created each time a new upload was made (however I couldn't reproduce the issue later)\n\n- your email and password for few cloud storages may float around in the `/home/HOSTINGUSERNAME/.config/rclone/rclone.conf` file","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falx-xlx%2Fbackup-website-to-cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falx-xlx%2Fbackup-website-to-cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falx-xlx%2Fbackup-website-to-cloud/lists"}