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