Last active
July 18, 2022 20:57
-
-
Save dmitriysafronov/d4d6d8b4b90eee8f882a1b6983a5099d to your computer and use it in GitHub Desktop.
Git backup monitor with [/root/.profile] snippet and [/etc/cron.daily/backup-addins] file and default [/.gitignore]
This file contains 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
# Exclude all | |
/* | |
# but essential directories and files | |
!/.gitignore | |
!/README.md | |
####################################### | |
####################################### | |
# /usr directory | |
!/usr | |
/usr/* | |
## /usr/local directory | |
!/usr/local | |
####################################### | |
# /root directory | |
!/root | |
/root/* | |
## root files | |
!/root/.bashrc | |
!/root/.bash_logout | |
!/root/.gitconfig | |
!/root/.profile | |
!/root/.selected_editor | |
/root/.ssh/*.old | |
/root/.ssh/id_* | |
!/root/.ssh |
This file contains 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
# GIT addon(s) | |
if [ -n "$(which git)" ]; then | |
if [ -n "$(git -C / status -s)" ]; then | |
echo "There are updates in '/', you can backup them manually with [/etc/cron.daily/backup-additions]!" | |
git -C / status -s | |
fi | |
if [ -n "$(git -C /etc status -s)" ]; then | |
echo "There are updates in '/etc', you can backup them manually with [/etc/cron.daily/etckeeper]!" | |
git -C /etc status -s | |
fi | |
fi |
This file contains 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
#!/usr/bin/env sh | |
git -C / add -A && git -C / commit -m "$(date +'%Y/%m/%d %H:%M:%S %:z')" && git -C / push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment