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