aboutsummaryrefslogtreecommitdiff
path: root/_posts/posts/2021-01-24-replacing-dropbox-with-s3.md
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-02-23 10:35:22 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-02-23 10:35:22 +0100
commit4abcce013c9ee3053badf2abda77190233066676 (patch)
tree450de7e8fed3c3c7501a9d2e2eb60a676bdfa09e /_posts/posts/2021-01-24-replacing-dropbox-with-s3.md
parentcdf50cb2e3051200c6ea0628c318d66220b7d1a1 (diff)
downloadmitjafelicijan.com-4abcce013c9ee3053badf2abda77190233066676.tar.gz
Testing thoughts page
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.md115
1 files changed, 115 insertions, 0 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
new file mode 100644
index 0000000..7599949
--- /dev/null
+++ b/_posts/posts/2021-01-24-replacing-dropbox-with-s3.md
@@ -0,0 +1,115 @@
1---
2title: Replacing Dropbox in favor of DigitalOcean spaces
3permalink: /replacing-dropbox-in-favor-of-digitalocean-spaces.html
4date: 2021-01-24T12:00:00+02:00
5layout: post
6type: post
7draft: false
8---
9
10A few months ago I experimented with DigitalOcean spaces as my backup solution
11that could [replace Dropbox
12eventually](/digitalocean-spaces-to-sync-between-computers.html). That solution
13worked quite nicely, and I was amazed how smashing together a couple of existing
14solutions would work this fine.
15
16I have been running that solution in the background for a couple of months now
17and kind of forgot about it. But recent developments around deplatforming and
18having us people hostages of technology and big companies speed up my goals to
19become 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)
22etc and take back some control.
23
24I am not a conspiracy theory nut, but to be honest, what these companies are
25doing lately is out of control. It is a matter of principle at this point. I
26have almost completely degoogled my life all the way from ditching Gmail,
27YouTube and most of the services surrounding Google. And I must tell you, I feel
28so good. I haven't felt this way for a long time.
29
30**Anyways. Let's get to the meat of things.**
31
32Before you continue you should read my post about [syncing to
33Dropbox](/digitalocean-spaces-to-sync-between-computers.html).
34
35> Also to note, I am using Linux on my machine with Gnome desktop environment.
36This 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)
38or [Cygwin](https://www.cygwin.com/).
39
40## Folder structure
41
42I liked structure from Dropbox. One folder where everything is located and
43synced. 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
53All of my code is located in `~/Vault/projects` folder. And most of the projects
54are Git repositories. I do not use this sync method for backup per see but in
55case I reinstall my machine I can easily recreate all the important folder
56structure with one quick command. No external drives needed that can fail etc.
57
58## Sync script
59
60My 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
68cd ~/Vault/backup/dotfiles
69
70MACHINE=$(whoami)@$(hostname)
71mkdir -p $MACHINE
72cd $MACHINE
73
74cp ~/.config/VSCodium/User/settings.json settings.json
75cp ~/.s3cfg s3cfg
76cp ~/.bash_extended bash_extended
77cp ~/.ssh ssh -rf
78
79codium --list-extensions > vscode-extension.txt
80dconf dump /com/gexperts/Tilix/ > tilix.dconf
81
82cd ~/Vault
83s3cmd sync --delete-removed --exclude 'node_modules/*' --exclude '.git/*' --exclude '.venv/*' ./ s3://bucket-name/backup/
84
85echo `date +"%D %T"` >> ~/.vault.log
86
87notify-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
93This script also backups some of the dotfiles I use and sends notification to
94Gnome notification center. It is a straightforward solution. Nothing special
95going 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
100You can use this script in a combination with [Cron](https://en.wikipedia.org/wiki/Cron).
101
102```txt
1030 2 * * * sh ~/Vault/bin/vault-backup.sh
104```
105
106When you start syncing your local stuff with a remote server you can review your
107items on DigitalOcean.
108
109![Dropbox Spaces](/assets/posts/dropbox-sync/dropbox-spaces.png){:loading="lazy"}
110
111I have been using this script now for quite some time, and it's working
112flawlessly. I also uninstalled Dropbox and stopped using it completely.
113
114All I need to do is write a Bash script that does the reverse and downloads from
115remote server to local folder. This could be another post.