diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-03-10 14:59:14 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-03-10 14:59:14 +0100 |
| commit | 1100562e29f6476448b656dbddd4cf22505523f6 (patch) | |
| tree | 442eec492199104bd49dfd74474ce89ade8fcac9 /_posts/posts/2021-01-24-replacing-dropbox-with-s3.md | |
| parent | a40d80be378e46a6c490e1b99b0d8f4acd968503 (diff) | |
| download | mitjafelicijan.com-1100562e29f6476448b656dbddd4cf22505523f6.tar.gz | |
Move back to JBMAFP
Diffstat (limited to '_posts/posts/2021-01-24-replacing-dropbox-with-s3.md')
| -rw-r--r-- | _posts/posts/2021-01-24-replacing-dropbox-with-s3.md | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/_posts/posts/2021-01-24-replacing-dropbox-with-s3.md b/_posts/posts/2021-01-24-replacing-dropbox-with-s3.md deleted file mode 100644 index 7599949..0000000 --- a/_posts/posts/2021-01-24-replacing-dropbox-with-s3.md +++ /dev/null | |||
| @@ -1,115 +0,0 @@ | |||
| 1 | --- | ||
| 2 | title: Replacing Dropbox in favor of DigitalOcean spaces | ||
| 3 | permalink: /replacing-dropbox-in-favor-of-digitalocean-spaces.html | ||
| 4 | date: 2021-01-24T12:00:00+02:00 | ||
| 5 | layout: post | ||
| 6 | type: post | ||
| 7 | draft: false | ||
| 8 | --- | ||
| 9 | |||
| 10 | A few months ago I experimented with DigitalOcean spaces as my backup solution | ||
| 11 | that could [replace Dropbox | ||
| 12 | eventually](/digitalocean-spaces-to-sync-between-computers.html). That solution | ||
| 13 | worked quite nicely, and I was amazed how smashing together a couple of existing | ||
| 14 | solutions would work this fine. | ||
| 15 | |||
| 16 | I have been running that solution in the background for a couple of months now | ||
| 17 | and kind of forgot about it. But recent developments around deplatforming and | ||
| 18 | having us people hostages of technology and big companies speed up my goals to | ||
| 19 | become less dependent on | ||
| 20 | [Google](https://edition.cnn.com/2020/12/17/tech/google-antitrust-lawsuit/index.html), | ||
| 21 | [Dropbox](https://www.pcworld.com/article/2048680/dropbox-takes-a-peek-at-files.html) | ||
| 22 | etc and take back some control. | ||
| 23 | |||
| 24 | I am not a conspiracy theory nut, but to be honest, what these companies are | ||
| 25 | doing lately is out of control. It is a matter of principle at this point. I | ||
| 26 | have almost completely degoogled my life all the way from ditching Gmail, | ||
| 27 | YouTube and most of the services surrounding Google. And I must tell you, I feel | ||
| 28 | so good. I haven't felt this way for a long time. | ||
| 29 | |||
| 30 | **Anyways. Let's get to the meat of things.** | ||
| 31 | |||
| 32 | Before you continue you should read my post about [syncing to | ||
| 33 | Dropbox](/digitalocean-spaces-to-sync-between-computers.html). | ||
| 34 | |||
| 35 | > Also to note, I am using Linux on my machine with Gnome desktop environment. | ||
| 36 | This should work on MacOS too. To use this on Windows I suggest using | ||
| 37 | [Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) | ||
| 38 | or [Cygwin](https://www.cygwin.com/). | ||
| 39 | |||
| 40 | ## Folder structure | ||
| 41 | |||
| 42 | I liked structure from Dropbox. One folder where everything is located and | ||
| 43 | synced. So, that's why adopted this also for my sync setup. | ||
| 44 | |||
| 45 | ```go | ||
| 46 | ~/Vault | ||
| 47 | ↳ backup | ||
| 48 | ↳ bin | ||
| 49 | ↳ documents | ||
| 50 | ↳ projects | ||
| 51 | ``` | ||
| 52 | |||
| 53 | All of my code is located in `~/Vault/projects` folder. And most of the projects | ||
| 54 | are Git repositories. I do not use this sync method for backup per see but in | ||
| 55 | case I reinstall my machine I can easily recreate all the important folder | ||
| 56 | structure with one quick command. No external drives needed that can fail etc. | ||
| 57 | |||
| 58 | ## Sync script | ||
| 59 | |||
| 60 | My sync script is located in `~/Vault/bin/vault-backup.sh` | ||
| 61 | |||
| 62 | ```bash | ||
| 63 | #!/bin/bash | ||
| 64 | |||
| 65 | # dconf load /com/gexperts/Tilix/ < tilix.dconf | ||
| 66 | # 0 2 * * * sh ~/Vault/bin/vault-backup.sh | ||
| 67 | |||
| 68 | cd ~/Vault/backup/dotfiles | ||
| 69 | |||
| 70 | MACHINE=$(whoami)@$(hostname) | ||
| 71 | mkdir -p $MACHINE | ||
| 72 | cd $MACHINE | ||
| 73 | |||
| 74 | cp ~/.config/VSCodium/User/settings.json settings.json | ||
| 75 | cp ~/.s3cfg s3cfg | ||
| 76 | cp ~/.bash_extended bash_extended | ||
| 77 | cp ~/.ssh ssh -rf | ||
| 78 | |||
| 79 | codium --list-extensions > vscode-extension.txt | ||
| 80 | dconf dump /com/gexperts/Tilix/ > tilix.dconf | ||
| 81 | |||
| 82 | cd ~/Vault | ||
| 83 | s3cmd sync --delete-removed --exclude 'node_modules/*' --exclude '.git/*' --exclude '.venv/*' ./ s3://bucket-name/backup/ | ||
| 84 | |||
| 85 | echo `date +"%D %T"` >> ~/.vault.log | ||
| 86 | |||
| 87 | notify-send \ | ||
| 88 | -u normal \ | ||
| 89 | -i /usr/share/icons/Adwaita/96x96/status/security-medium-symbolic.symbolic.png \ | ||
| 90 | "Vault sync succeded at `date +"%D %T"`" | ||
| 91 | ``` | ||
| 92 | |||
| 93 | This script also backups some of the dotfiles I use and sends notification to | ||
| 94 | Gnome notification center. It is a straightforward solution. Nothing special | ||
| 95 | going on. | ||
| 96 | |||
| 97 | > One obvious benefit of this is that I can omit syncing Node's `node_modules` | ||
| 98 | > or Python's `.venv` and `.git` folders. | ||
| 99 | |||
| 100 | You can use this script in a combination with [Cron](https://en.wikipedia.org/wiki/Cron). | ||
| 101 | |||
| 102 | ```txt | ||
| 103 | 0 2 * * * sh ~/Vault/bin/vault-backup.sh | ||
| 104 | ``` | ||
| 105 | |||
| 106 | When you start syncing your local stuff with a remote server you can review your | ||
| 107 | items on DigitalOcean. | ||
| 108 | |||
| 109 | {:loading="lazy"} | ||
| 110 | |||
| 111 | I have been using this script now for quite some time, and it's working | ||
| 112 | flawlessly. I also uninstalled Dropbox and stopped using it completely. | ||
| 113 | |||
| 114 | All I need to do is write a Bash script that does the reverse and downloads from | ||
| 115 | remote server to local folder. This could be another post. | ||
