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