diff options
| author | Xiao Pan <gky44px1999@gmail.com> | 2024-03-06 01:46:07 -0800 | 
|---|---|---|
| committer | Xiao Pan <gky44px1999@gmail.com> | 2024-03-06 01:46:07 -0800 | 
| commit | 1c15b373adbf26e0ec60b561b868afeba30ec666 (patch) | |
| tree | 8a4bdbb142753349e2d01ec78fdce27262afa4c5 /sh | |
| parent | 201fe0d4adcf92049b920c1abd339e6507e25397 (diff) | |
feat: upd consider xyzia, still need more codes
Diffstat (limited to 'sh')
| -rwxr-xr-x | sh/upd | 22 | 
1 files changed, 15 insertions, 7 deletions
@@ -4,7 +4,9 @@ all () {  	fast  	clean  	[ "$hostname" != xyzpp ] && refl -	[ "$hostname" = xyzka ] && qb +	if [ "$hostname" = xyzka ] || [ "$hostname" = xyzia ]; then +		qb +	fi  	[ "$hostname" = xyzinsp ] && music  	if [ "$hostname" = xyzinsp ] || [ "$hostname" = xyzpp ]; then  		userjs @@ -25,8 +27,10 @@ backup () {  		git branch | awk '{print ($1=="*")?$2:$1}' | while read -r branch; do  			git checkout "$branch"  			git pull -			# Push ka branch 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. -			[ "$branch" = ka ] && git push +			# Push ka and ia branch 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 +				ka|ia) git push;; +			esac  		done  		# git checkout will change mtime, need to change back so rsync won't think it needs to backup these files  		# https://stackoverflow.com/q/1964470/9008720 @@ -53,15 +57,17 @@ backup () {  	if [ "$hostname" = xyzinsp ] || [ "$hostname" = xyzstudio ]; then  		# rsync backup from ka  		rsync -avPR --delete ka:/home/xyz/.config/qBittorrent :/home/xyz/.local/share/qBittorrent/BT_backup "$HOME/backup/ka" +		# rsync backup from ia +		rsync -avPR --delete ia:/home/xyz/.config/qBittorrent :/home/xyz/.local/share/qBittorrent/BT_backup "$HOME/backup/ia"  	fi -	if [ "$hostname" != xyzstudio ] && [ "$hostname" != xyzka ]; then +	if [ "$hostname" != xyzstudio ] && [ "$hostname" != xyzka ] && [ "$hostname" != xyzia ] ; then  		# rsync backup to studio  		# --files-from make -a not imply -r, so need to specify explicitly  		rsync -avPRr --delete --files-from="$XDG_CONFIG_HOME/myconf/upd_rsync_files" / "studio:/home/xyz/backup/$backup_branch"  	fi -	if [ "$hostname" != xyzka ]; then +	if [ "$hostname" != xyzka ] && [ "$hostname" != xyzia ]; then  		# duplicity backup to ka  		# 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/... @@ -104,7 +110,9 @@ clean () {  fast () {  	pac  	misc -	[ "$hostname" != xyzka ] && backup +	if [ "$hostname" != xyzka ] && [ "$hostname" != xyzia ]; then +		backup +	fi  }  userjs () { @@ -204,7 +212,7 @@ refl () {  	# rsync may need to change XferCommand in /etc/pacman.conf  	# https://www.reddit.com/r/archlinux/comments/mynw6e/rsync_mirrors_with_pacman/  	# need --delay so no super out of sync mirrors -	if [ "$hostname" != xyzka ]; then +	if [ "$hostname" != xyzka ] && [ "$hostname" != xyzia ]; then  		sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country us --protocol https --delay 1 --latest 25 --score 25 --fastest 10  	else  		sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country ro --protocol https --delay 1 --fastest 3  | 
