User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
selfhost:backup [2024/03/22 08:30] – [Backup] willyselfhost:backup [2025/03/13 09:29] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Backup ======+====== E) Backup ======
  
 Doing backups for your data is, how to day, **critical**! But you need to answer a few questions first: Doing backups for your data is, how to day, **critical**! But you need to answer a few questions first:
Line 17: Line 17:
  
 In other words: __backups are there to protect the data from yourself__. In other words: __backups are there to protect the data from yourself__.
 +
 ===== What do i want to backup? ===== ===== What do i want to backup? =====
  
 Backing up everything would require a duplicate of your storage. Is it really needed? No it's not. Backing up everything would require a duplicate of your storage. Is it really needed? No it's not.
  
-First of all, i do not backup anything that i could download again. +First of all, i do not backup anything that i could download again. Also, i don't backup binaries, services or the Operating System itself, anything that i can reinstall or reconfigure myself. For this, i keep notes (this wiki) and backup those notes.
- +
-Also, i don't backup binaries, services or the Operating System itself.+
  
 I **do** backup all personal data like documents, scanned documents, photos taken by me, source code written by me, calendars and contacts and so on. I **do** backup all personal data like documents, scanned documents, photos taken by me, source code written by me, calendars and contacts and so on.
Line 32: Line 31:
 ===== Where to store my backups? ===== ===== Where to store my backups? =====
  
-Don'store them on the server. I have OpenWRT WiFi Access Points with a USB plug, so i connected a big enough SSD over USB and that's my first backup destination. I have mounted that filesystem via NFS on the server so it's easy and simple.+You can store them on the server, but this **must not** be the only backup you do. I have OpenWRT WiFi Access Points with a USB plug, so i connected a big enough 2.5' hard drive over USB and that's my second backup destination. It is accessible via SFTP from the serverso it's easy to access.
  
-You will also need a second, off-site backup storage: some cloud system (like gdrive or dropbox) might work, but using your external server could even be a better idea. After all, you already pay for it and 99% of it's storage space is probably wasted anyway.+You will also need a third, off-site backup storage: some cloud system (like gdrive or dropbox) might work, but using your external server could even be a better idea. After all, you already pay for it and 99% of it's storage space is probably wasted anyway.
  
 Of course, if you have your in-laws with good internet connection you might plug a usb-drive there too and use that as well... More the better...  Of course, if you have your in-laws with good internet connection you might plug a usb-drive there too and use that as well... More the better... 
  
  
-===== Backup Solutions =====+===== Backup Solutions for the server =====
  
 There are tons of backup solutions out there. I wanted a no fuss, jut works practical solution that is encrypted, has been around for long enough to be stable, and has outstanding user feed-backs. There are tons of backup solutions out there. I wanted a no fuss, jut works practical solution that is encrypted, has been around for long enough to be stable, and has outstanding user feed-backs.
Line 53: Line 52:
 === Installation === === Installation ===
  
 +Unmask the latest release and emerge it:
 <code bash> <code bash>
 +echo "app-backup/restic ~amd64" >> /etc/portage/package.accept_keywords/restic
 emerge restic emerge restic
 </code> </code>
  
-=== Usage ===+After installing Restic (the CLI) you might want to install also Backrest, a nice web GUI for Restic. Refer to [[services:backrest|this]] page for more details. 
 + 
 + 
 +=== Usage (web GUI ) === 
 + 
 +To use [[services:backrest|Backrest]] you can refer to it's [[https://garethgeorge.github.io/backrest/|Wiki]] pages. 
 + 
 +=== Usage (CLI)=== 
 + 
 +The following commands are always valid, specially if your Backrest is not operational.
  
 Create new storage repository with: Create new storage repository with:
Line 85: Line 95:
  
  
-+ put into crontab +===== Backup Solutions for mobile devices =====
- +
-For SyncThing to be useful you need to run it as the **users** group, and you should also ensure SyncThing data and logs are stored on your raid arrays. Edit the **/etc/conf.d/syncthing** configuration file: +
-<file - synchting> +
-SYNCTHING_USER="syncthing" +
-SYNCTHING_GROUP="users" +
- +
-# Configuration directory +
-SYNCTHING_HOMEDIR="/data/syncthing/.config/syncthing" +
- +
-# Log file location +
-SYNCTHING_LOGFILE="/data/syncthing/syncthing.log" +
-</file> +
- +
-And create the **/data/syncthing** folder that will contain default shared folders and logs: +
-<code bash> +
-mkdir /data/syncthing +
-</code> +
- +
-===== Usage ===== +
- +
-Add it to default runlevel and start it: +
-<code bash> +
-rc-update add syncthing default +
-/etc/init.t/syncthing start +
-</code> +
- +
-Open your browser to **http://127.0.0.1/8384**+
  
 +Backups for your phones and tablets is a different matter because you want it fast and effective:
 +  * Your phone might fall into water a few minutes after taking that lifechanging picture
 +  * Your phone might get stolen at any time
 +  * Your phone might have limited bandwidth and/or data caps most of the time you are not home
  
 +Also, mounting remote shares is not practical (if even feasible in most cases) and even running cron jobs isn't. 
  
 +Luckly there is a great solution that you can use, and it's [[gentoo:syncthing|SyncThing]]. Yes, it is __not__ a backup solution by itself, but if you pair it to //Restic// once the files are stored oin the server, there you go!
  
 +Check the above linked page and install SyncThing on your server. Set it up either with a common backup user or even better setup one dedicated synthing instance for each user you want to backup. This way it's more work to set it up, but each user files are isolated, and your users can individually access them too.
  
 +Then setup syncthing on the phone and add as many sync folders as you need. 
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information