From cc98d95f1411f6701114029bc340074c836443f9 Mon Sep 17 00:00:00 2001 From: DoTheEvolution Date: Sat, 9 May 2020 17:13:49 +0200 Subject: [PATCH] update --- arch_linux_host_install/readme.md | 11 +++++----- borg_backup/readme.md | 36 ++++++++++++++++++++++++------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/arch_linux_host_install/readme.md b/arch_linux_host_install/readme.md index 4e2cf6b..62090ff 100644 --- a/arch_linux_host_install/readme.md +++ b/arch_linux_host_install/readme.md @@ -32,7 +32,7 @@ Google for plenty of tutorials and youtube videos alongside arch wiki. `sudo dd bs=4M if=archlinux-2020.05.01-x86_64.iso of=/dev/sdX status=progress oflag=direct` -The above command will fuck your machine up if you dunno what you are doing +The above command will fuck your machine up if you dunno what you are doing. # Boot from the usb @@ -71,7 +71,7 @@ So if theres boot menu option choose non-uefi. * set hostname
`echo docker-host > /etc/hostname` * add new user and set their password
- `useradd -m -G wheel bastard` + `useradd -m -G wheel bastard`
`passwd bastard` * edit sudoers to allow users group wheel to sudo
`EDITOR=nano visudo`
@@ -98,7 +98,7 @@ So if theres boot menu option choose non-uefi. `nano /etc/fstab`
*/swapfile none swap defaults 0 0* * enable colors in pacman.conf
- `nano /etc/pacman.conf` + `nano /etc/pacman.conf`
*Color* * reboot
`reboot` @@ -125,8 +125,7 @@ it's the fastest zsh framework and out of the box setup nicely * install zsh package
`sudo pacman -S zsh` -* change users default shell to zsh
- `chsh -s /bin/zsh`
+* install zim, it changes users default shell to zsh
`curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh` ### Setup docker @@ -141,7 +140,7 @@ it's the fastest zsh framework and out of the box setup nicely ### Extra stuff -* `sudo pacman -S vim git cronie curl borg htop lm_sensors nnn bind-tools` +* `sudo pacman -S vim git cronie curl borg htop lm_sensors nnn bind-tools python-llfuse` * install yay for access to AUR packages
`git clone https://aur.archlinux.org/yay-bin.git`
`cd yay-bin && makepkg -si`
diff --git a/borg_backup/readme.md b/borg_backup/readme.md index 022411f..4a080a5 100644 --- a/borg_backup/readme.md +++ b/borg_backup/readme.md @@ -60,9 +60,11 @@ and the log file is created on the first run. Borg is likely in your linux repositories. #### Create a new borg repo - + `mkdir ~/borg`
-`borg init --encryption=none ~/borg/docker_backup` +`sudo borg init --encryption=none ~/borg/docker_backup` + +Note the sudo. Borg commands should be run as root, so it can access everything. #### The backup script @@ -125,15 +127,33 @@ echo '------------------------------' >> $LOGFILE # borg delete .::1584472836 ``` -the script must be **executabe** - `chmod +x borg_backup.sh` +The script must be **executabe** - `chmod +x borg_backup.sh` + +`sudo /home/spravca/borg/borg_backup.sh` + +It could ask about +*Attempting to access a previously unknown unencrypted repository*
+Answer yes, this could be important as the automatic backup would stop at +this question otherwise. #### Automatic execution -as root, cron job every day at 3:00
-`su` - switch to root
-`crontab -e`
-`0 3 * * * /home/bastard/borg/borg_backup.sh`
-`crontab -l`
+Using [cron](https://wiki.archlinux.org/index.php/cron) + +* `su` - switch to root +* `crontab -e` - add new cron job
+* `0 3 * * * /home/bastard/docker/nextcloud/nextcloud-backup-script.sh`
+ runs it every day [at 03:00](https://crontab.guru/#0_03_*_*_*) +* `crontab -l` - list cronjobs to check + +# Accessing the backup files + +* `cd /home/bastard/borg/docker_backup/` - go in to the borg repo +* `sudo borg list .` - list the archives +* choose one by the date, copy its identifier which is epoch time, e.g. 1588986941 +* `sudo borg mount .::1588986941 /mnt/temp` - mount it to some folder +* browse the directory where mounted and do whatever is needed +* `sudo borg umount /mnt/temp` - umount the backup # Extra info