All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login

All gists matching topic shell

Recently created
Least recently created
Recently updated
Least recently updated
gaiety's Avatar

gaiety / dotfiles-link.sh

0 likes
0 forks
1 files
Last active 1753035078
Links need to be absolute, which is hard when you don't know where a git repo will be cloned to. This helps with that!
bash link script shell
1 # Link current directory instead of having to always do absolute
2 ln -s "$(pwd)/cool-tool" ~/.config/cool-tool
gaiety's Avatar

gaiety / rsync-status-check.sh

0 likes
0 forks
1 files
Last active 1752986223
rsync success/fail message
bash rsync script shell
1 # rsync ./src ./copy
2
3 if [ "$?" -eq "0" ]; then
4 # rsync succeeded, 2nd to last line of log has some data amount moved for a message
5 MESSAGE=$(tail $logFile -n 2 | head -n 1)
6 else
7 # rsync failed, take last line and make it the message
8 MESSAGE=$(tail $logFile -n 1)
9 fi
gaiety's Avatar

gaiety / Rsync the Linux Root Dir

0 likes
0 forks
1 files
Last active 1752986011
Without the cruft! It's nice to do a partial system root backup of Linux with rsync, this has a lot of excludes already for you.
bash rsync script shell
1 rsync -a \
2 --log-file=$logFile \
3 --exclude=/swap.img \
4 --exclude=/snap \
5 --exclude=/dev \
6 --exclude=/mnt \
7 --exclude=/proc \
8 --exclude=/sys \
9 --exclude=/tmp \
10 --exclude=/var/tmp \
Newer Older

Powered by Opengist ⋅ Load: 99ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ Links ⋅ Portfolio ⋅ Git