{"id":15397386,"url":"https://github.com/connor-baer/server-scripts","last_synced_at":"2026-02-10T19:02:02.204Z","repository":{"id":76829156,"uuid":"87068482","full_name":"connor-baer/server-scripts","owner":"connor-baer","description":"🛠 Shell scripts to manage and maintain Ubuntu servers.","archived":false,"fork":false,"pushed_at":"2024-09-25T15:34:23.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T13:06:04.939Z","etag":null,"topics":["bash","devops-tools","shell-scripts","ubuntu"],"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/connor-baer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-04-03T11:51:18.000Z","updated_at":"2022-12-06T11:06:34.000Z","dependencies_parsed_at":"2024-10-19T04:25:32.755Z","dependency_job_id":null,"html_url":"https://github.com/connor-baer/server-scripts","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"bb2efb34defd1dea3cae9a273b1540f54c84fec1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/connor-baer/server-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-baer%2Fserver-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-baer%2Fserver-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-baer%2Fserver-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-baer%2Fserver-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connor-baer","download_url":"https://codeload.github.com/connor-baer/server-scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-baer%2Fserver-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29312973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T17:48:59.043Z","status":"ssl_error","status_checked_at":"2026-02-10T17:45:37.240Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["bash","devops-tools","shell-scripts","ubuntu"],"created_at":"2024-10-01T15:37:33.158Z","updated_at":"2026-02-10T19:02:01.832Z","avatar_url":"https://github.com/connor-baer.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# server-scripts\nShell scripts to manage and maintain Ubuntu servers\n\n## Overview\n\nThere are several scripts included in `server-scripts`, each of which perform different functions. They all use a shared `.env.sh` to function. This `.env` should be created on each environment where you wish to run the `server-scripts`, and it should be excluded from your git repo via `.gitignore`.\n\n### `backup_s3.sh`\n\nThe `backup_s3.sh` script syncs the backups from `LOCAL_BACKUPS_PATH` to the Amazon S3 bucket specified in `REMOTE_S3_BUCKET`.\n\nThis script assumes that you have already [installed awscli](http://docs.aws.amazon.com/cli/latest/userguide/installing.html) and have [configured it](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) with your credentials.\n\nIt's recommended that you set up a separate user with access to only S3, and set up a private S3 bucket for your backups.\n\n### `backup_dropbox.sh`\n\nThe `backup_dropbox.sh` script uploads a compressed archive of the backups from `LOCAL_BACKUPS_PATH` to the Dropbox folder specified in `REMOTE_DROPBOX_PATH`.\n\nThis script assumes that you have already [installed dbxcli](https://github.com/dropbox/dbxcli#installation) and have configured it with your credentials.\n\n### Setting it up\n\n1. Download or clone the `server-scripts` git repo to your server.\n2. Duplicate the `example.env` file, and rename it to `.env`.\n3. Then open up the `.env` file into your favorite editor, and replace `REPLACE_ME` with the appropriate settings.\n4. Optionally set up [automatic script execution](#automatic-script-execution).\n\nAll configuration is done in the `.env` file, rather than in the scripts themselves. This is is so that the same scripts can be used in multiple environments such as `local` dev, `staging`, and `live` production without modification. Just create a `.env` file in each environment, and keep it out of your git repo via `.gitignore`.\n\n#### Local Settings\n\nAll settings that are prefaced with `LOCAL_` refer to the local environment where the script will be run, **not** your `local` dev environment.\n\n`LOCAL_ROOT_PATH` is the absolute path to the root of your local server install, with a trailing `/` after it.\n\n`LOCAL_CHOWN_USER` is the user that is the owner of your entire server install.\n\n`LOCAL_CHOWN_GROUP` is your webserver's group, usually either `nginx` or `apache`.\n\n`LOCAL_BACKUPS_PATH` is the absolute path to the directory where local backups should be stored. For database backups, a sub-directory `LOCAL_DB_NAME/db` will be created inside the `LOCAL_BACKUPS_PATH` directory to store the database backups. Paths should always have a trailing `/`\n\n#### Remote Settings\n\nAll settings that are prefaced with `REMOTE_` refer to the remote environment where assets and the database will be pulled from.\n\n`REMOTE_SSH_LOGIN` is your ssh login to the remote server, e.g.: `user@domain.com`\n\n`REMOTE_SSH_PORT` is the port to use for ssh on the remote server. This is normally `22`\n\n`REMOTE_ROOT_PATH` is the absolute path to the root of your server install on the remote server, with a trailing `/` after it.\n\n`REMOTE_BACKUPS_PATH` is the absolute path to the directory where the remote backups are stored. For database backups, a sub-directory `REMOTE_DB_NAME/db` inside the `REMOTE_BACKUPS_PATH` directory is used for the database backups. Paths should always have a trailing `/`\n\n`REMOTE_S3_BUCKET` is the name of the Amazon S3 bucket to backup to via the `backup_s3.sh` script\n\n`REMOTE_DROPBOX_PATH` is the path of the Dropbox folder to backup to via the `backup_dropbox.sh` script\n\n`REMOTE_SLACK_HOOK` is the incoming webhook url to post notifications to Slack via the `notify_slack.sh` script\n\n`REMOTE_TELEGRAM_HOOK` is the incoming webhook url to post notifications to Telegram via the `notify_telegram.sh` script\n\n`REMOTE_TELEGRAM_CHAT_ID` is the chat id to post notifications to Telegram via the `notify_telegram.sh` script\n\n### Setting up SSH Keys\n\nNormally when you `ssh` into a remote server (as some of the `server-scripts` do), you have to enter your password. Best practices from a security POV is to not allow for password-based logins, but instead use [SSH Keys](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2).\n\nThe day in, day out benefit of setting up SSH Keys is that you never have to enter your password again, so it allows for automated execution of the various `server-scripts`. Use the excellent [How To Set Up SSH Keys](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2) artice as a guide for setting up your SSH keys.\n\n### Permissions and Git\n\nIf you use `git`, a sample `.gitignore` file that you can modify \u0026 use for your server projects is included in `server-scripts` as `example.gitignore`. If you wish to use it, the file should be copied to your server project root, and renamed `.gitignore`\n\nIf you change file permissions on your remote server, you may encounter git complaining about `overwriting existing local changes` when you try to deploy. This is because git considers changing the executable flag to be a change in the file, so it thinks you changed the files on your server (and the changes are not checked into your git repo).\n\nTo fix this, we just need to tell git to ignore permission changes on the server. You can change the `fileMode` setting for `git` on your server, telling it to ignore permission changes of the files on the server:\n\n    git config --global core.fileMode false\n\nSee the [git-config man page](https://git-scm.com/docs/git-config#git-config-corefileMode) for details.\n\n### Automatic Script Execution\n\nIf you want to run any of these scripts automatically at a set schedule, here's how to do it. We'll use the `backup_dropbox.sh` script as an example, but the same applies to any of the scripts.\n\nPlease see the **Setting up SSH Keys** section and set up your SSH keys before you set up automatic script execution.\n\n#### On Linux\n\nIf you're using [Forge](https://forge.laravel.com/) you can set the `backup_dropbox.sh` script to run nightly (or whatever interval you want) via the Scheduler. If you're using [ServerPilot.io](https://serverpilot.io/community/articles/how-to-use-cron-to-schedule-scripts.html) or are managing the server yourself, just set the `backup_dropbox.sh` script to run via `cron` at whatever interval you desire.\n\n🐼 [Made by Connor](https://madebyconnor.co/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnor-baer%2Fserver-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnor-baer%2Fserver-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnor-baer%2Fserver-scripts/lists"}