Created
March 21, 2024 05:23
-
-
Save hotta/5c72be047397cd6bcc4e937ccc7a5041 to your computer and use it in GitHub Desktop.
指定したユーザーのドットファイルをまとめて収集する。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Gather dotfiles of specified users. | |
ARC=/tmp/dotfiles.tar | |
USERS=(user1 user2 user3) | |
sudo sh -c "tar cf $ARC /home/etl/.??*" || exit 1 | |
for u in ${USERS[@]} ; do | |
echo $u | |
sudo sh -c "tar rf $ARC /home/$u/.??*" || exit 1 | |
done | |
sudo gzip $ARC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment