update
This commit is contained in:
parent
b5d150409a
commit
cc98d95f14
|
@ -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</br>
|
||||
`echo docker-host > /etc/hostname`
|
||||
* add new user and set their password</br>
|
||||
`useradd -m -G wheel bastard`
|
||||
`useradd -m -G wheel bastard`</br>
|
||||
`passwd bastard`
|
||||
* edit sudoers to allow users group wheel to sudo</br>
|
||||
`EDITOR=nano visudo`</br>
|
||||
|
@ -98,7 +98,7 @@ So if theres boot menu option choose non-uefi.
|
|||
`nano /etc/fstab`</br>
|
||||
*/swapfile none swap defaults 0 0*
|
||||
* enable colors in pacman.conf</br>
|
||||
`nano /etc/pacman.conf`
|
||||
`nano /etc/pacman.conf`</br>
|
||||
*Color*
|
||||
* reboot</br>
|
||||
`reboot`
|
||||
|
@ -125,8 +125,7 @@ it's the fastest zsh framework and out of the box setup nicely
|
|||
|
||||
* install zsh package</br>
|
||||
`sudo pacman -S zsh`
|
||||
* change users default shell to zsh</br>
|
||||
`chsh -s /bin/zsh`</br>
|
||||
* install zim, it changes users default shell to zsh</br>
|
||||
`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</br>
|
||||
`git clone https://aur.archlinux.org/yay-bin.git`</br>
|
||||
`cd yay-bin && makepkg -si`</br>
|
||||
|
|
|
@ -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`</br>
|
||||
`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*</br>
|
||||
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</br>
|
||||
`su` - switch to root</br>
|
||||
`crontab -e`</br>
|
||||
`0 3 * * * /home/bastard/borg/borg_backup.sh`</br>
|
||||
`crontab -l`</br>
|
||||
Using [cron](https://wiki.archlinux.org/index.php/cron)
|
||||
|
||||
* `su` - switch to root
|
||||
* `crontab -e` - add new cron job</br>
|
||||
* `0 3 * * * /home/bastard/docker/nextcloud/nextcloud-backup-script.sh`</br>
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue