diff options
Diffstat (limited to 'sh')
| -rwxr-xr-x | sh/upd | 18 | 
1 files changed, 8 insertions, 10 deletions
@@ -9,7 +9,7 @@ all () {  	# pp maybe finish upd -a first and start to suspend, and it cause insp music() failed to rsync to pp, so I need to finish rsync to ssh before pp finish upd, so I put music() here, not perfect but good enough  	[ "$hostname" = xyzinsp ] && music  	# monthly_misc() needs to use qbittorrent-nox APIs, so I need to restart qbt before that, so I put qb() at top here, not perfect but good enough -	if [ "$hostname" = xyzia ] || [ "$hostname" = xyzib ]; then +	if [ "$hostname" = xyzib ]; then  		qb  	fi  	fast @@ -32,14 +32,14 @@ backup () {  	esac  	if [ "$hostname" = xyzinsp ]; then -		# Pull repos and branches from studio, so one more backup on insp or duplicity will backup to ia,for one more backup for 321 backup rule +		# Pull repos and branches from studio, so one more backup on insp or duplicity will backup to ib,for one more backup for 321 backup rule  		# cfgl master and pp branches already satisfy 321 rule. Here are three copies: 1. master/pp, 2. studio, 3. gitlab or alternative  		# But I still copy those on insp because one more copy will not hurt. And all my other data still satisfy 3 copies without backup to gitlab, so why left out cfgl? Also it may be nice if I what to use that local dir for searching things.  		cd "$HOME/programs/config_local_arch" || exit  		git branch | awk '{print ($1=="*")?$2:$1}' | while read -r branch; do  			git checkout "$branch"  			git pull -			# Push ca, ia, and other new vps branches (which means any branches other than master/studio/pp) to codeberg or any future alternative website for mirroring. Needed for public codes/data, considering my death may result in all copies on my computers being lost. +			# Push ca, and other new vps branches (which means any branches other than master/studio/pp) to codeberg or any future alternative website for mirroring. Needed for public codes/data, considering my death may result in all copies on my computers being lost.  			case "$branch" in  				master|studio|pp) ;;  				*) git push;; @@ -66,10 +66,9 @@ backup () {  	fi  	if [ "$hostname" = xyzinsp ] || [ "$hostname" = xyzstudio ]; then -		# rsync backup from ia -		rsync -avPR --delete xyz@ia.flylightning.xyz:/home/xyz/.config/qBittorrent :/home/xyz/.local/share/qBittorrent/BT_backup "$HOME/backup/ia" +		# rsync backup from ib  		rsync -avPR --delete xyz@ib.flylightning.xyz:/home/xyz/.config/qBittorrent :/home/xyz/.local/share/qBittorrent/BT_backup "$HOME/backup/ib" -		# In the future, maybe other VPS servers also need bakcup to insp and studio. Now, both ia and ib need +		# In the future, maybe other VPS servers also need bakcup to insp and studio.  	fi  	if [ "$hostname" = xyzinsp ] || [ "$hostname" = xyzpp ]; then @@ -79,7 +78,7 @@ backup () {  	fi  	if [ "$hostname" = xyzinsp ] || [ "$hostname" = xyzstudio ] || [ "$hostname" = xyzpp ]; then -		# duplicity backup to ia +		# duplicity backup to ib  		# https://wiki.archlinux.org/title/Duplicity  		# Need // for absolute path, see manpage URL FORMAT section. If not use //, will store to /home/xyz/home/xyz/...  		# --files-from has a bug, this bug makes source url that is / not working while /home works, more see vq notes @@ -232,7 +231,7 @@ refl () {  	# https://www.reddit.com/r/archlinux/comments/mynw6e/rsync_mirrors_with_pacman/  	# need --delay so no super out of sync mirrors  	case "$hostname" in -		xyzia|xyzib) sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country ro --protocol https --delay 1 --fastest 3;; +		xyzib) sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country ro --protocol https --delay 1 --fastest 3;;  		# aa now default wireguard to ca, so I choose to copy ca mirrorlist to aa instead  		# old cn mirrorlists code, only 2 cn mirror servers satisfied `--delay 1`, https://mirrors.jlu.edu.cn/archlinux/$repo/os/$arch is better than https://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch , the latter had issues  		#xyzaa) sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country cn --protocol https --delay 1 --fastest 2;; @@ -259,9 +258,8 @@ monthly_misc () {  		fi  		# https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1) -		curl -sS -X POST 'iawg:57151/api/v2/search/updatePlugins' &  		curl -sS -X POST 'ibwg:57151/api/v2/search/updatePlugins' & -		for qbt_wireguard_host in stwg iawg ibwg; do +		for qbt_wireguard_host in stwg ibwg; do  			curl -sS https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt | awk '$0{printf("%s\\n",$0)}' | xargs -0 -I {} curl -sS -d json='{"add_trackers":"{}"}' "$qbt_wireguard_host:57151/api/v2/app/setPreferences" &  			# another way: `jq -r '.[]|"\(.added_on)\t\(.hash)\t\(.name)"'`  			curl -sS "$qbt_wireguard_host:57151/api/v2/torrents/info?category=useful" | jq -r '.[]|[.added_on,.hash,.name]|@tsv' | grep 'archlinux.*\.iso' | sort -n | head -n-1 | awk '{print $2}' | while read -r hash; do  | 
