home/bin/rsync.sh

103 lines
2 KiB
Bash
Raw Normal View History

I3 to Sway (#1) Added some ignored folders and files Updated waybar clock for Debian 11 Fixed bug on screen definition Fixed Iiyama North America PL2483H 1173700204528 Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Some changes for work environment Some changes for work environment Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Added .mp3 files Updated waybar config for laptop Added vim-jsx Added Teams to startup section (sad day in life!) Updated mpd config (local source) Added script for syncing my music Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated ranger config Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Replaced termite with alacritty Replaced termite by alacritty Updated rsync.sh results Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated github user Updated irc alias Minor changes Added master if fail fait dev* Added zsh prompt Updated output definitions Added KDEConnect at startup Added second screen Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated README Added C.A.V.A. Fixed bug for vte Added Tofu HHKB keyboard config Added script to update system Updated FuzzFm entry Added menu entry for Carnet Added qcad's ebuild Updated waybar for Thinkpad Updated temperature list for Thinkpad Fixed bug Updated input for thinkpad Added script to order files for Alpine car audio system Updated Fuzz url Added Grammalecte plugin Added displays for ThinkStation and ThinkPad Merge branch 'gentoo-sway' of framagit.org:dbroqua/home into gentoo-sway Updated waybar for laptop Fixed bug on adjust brightness Moved applications Co-authored-by: dbroqua <contact@darkou.fr> Co-authored-by: dbroqua <dbroqua@mousur.org> Reviewed-on: https://git.darkou.fr/dbroqua/home/pulls/1 Co-Authored-By: Damien Broqua <dbroqua@noreply.localhost> Co-Committed-By: Damien Broqua <dbroqua@noreply.localhost>
2021-10-21 21:40:47 +02:00
#!/bin/bash
TYPE='' # usb / sshfs
CMD=rsync
ARGS='-avz --delete
--exclude /Nextcloud
--exclude /.cache
--exclude /Downloads
--exclude /.thunderbird
--exclude /Projects
--exclude /Software
--exclude /tmp
--exclude /fonts
--exclude /Music
--exclude /node_modules
--exclude /snap
--exclude /.local/share/Trash
--exclude /.npm
--exclude /.thumbnails
--exclude /Android
--exclude /.AndroidStudio*
--exclude /.android
--exclude /.bundle/cache
--exclude /.config/cache
--exclude /.config/Code/Cache
--exclude /.config/Code/CachedData
--exclude /.config/Slack
--exclude /.config/*/Cache
--exclude /.config/chromium
--exclude /.mozilla
--exclude /.config/discord
--exclude /.config/spotify
--exclude /.crashlytics
--exclude /.fastlane
--exclude /.gradle
--exclude ./Software
--exclude /.local
2022-01-25 13:24:57 +01:00
--exclude /.DataGrip*
2022-03-07 07:25:13 +01:00
--exclude /.eclipse
2022-04-18 23:36:58 +02:00
--exclude /sshfs
2022-01-25 13:24:57 +01:00
--exclude /OneDrive'
I3 to Sway (#1) Added some ignored folders and files Updated waybar clock for Debian 11 Fixed bug on screen definition Fixed Iiyama North America PL2483H 1173700204528 Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Some changes for work environment Some changes for work environment Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Added .mp3 files Updated waybar config for laptop Added vim-jsx Added Teams to startup section (sad day in life!) Updated mpd config (local source) Added script for syncing my music Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated ranger config Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Replaced termite with alacritty Replaced termite by alacritty Updated rsync.sh results Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated github user Updated irc alias Minor changes Added master if fail fait dev* Added zsh prompt Updated output definitions Added KDEConnect at startup Added second screen Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated README Added C.A.V.A. Fixed bug for vte Added Tofu HHKB keyboard config Added script to update system Updated FuzzFm entry Added menu entry for Carnet Added qcad's ebuild Updated waybar for Thinkpad Updated temperature list for Thinkpad Fixed bug Updated input for thinkpad Added script to order files for Alpine car audio system Updated Fuzz url Added Grammalecte plugin Added displays for ThinkStation and ThinkPad Merge branch 'gentoo-sway' of framagit.org:dbroqua/home into gentoo-sway Updated waybar for laptop Fixed bug on adjust brightness Moved applications Co-authored-by: dbroqua <contact@darkou.fr> Co-authored-by: dbroqua <dbroqua@mousur.org> Reviewed-on: https://git.darkou.fr/dbroqua/home/pulls/1 Co-Authored-By: Damien Broqua <dbroqua@noreply.localhost> Co-Committed-By: Damien Broqua <dbroqua@noreply.localhost>
2021-10-21 21:40:47 +02:00
ORIG='/home/dbroqua/'
DEST=''
HOSTNAME=`hostname`
# USB
UUID='6e3f7ae3-8fa1-43f3-88c0-a12651519ffb'
MOUNT='/mnt/backup'
DEST_USB="/mnt/backup/${HOSTNAME}/dbroqua/"
# SSHFS
2022-01-25 13:24:57 +01:00
DEST_SSHFS="dmc-12:Backup/${HOSTNAME}/dbroqua/"
I3 to Sway (#1) Added some ignored folders and files Updated waybar clock for Debian 11 Fixed bug on screen definition Fixed Iiyama North America PL2483H 1173700204528 Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Some changes for work environment Some changes for work environment Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Added .mp3 files Updated waybar config for laptop Added vim-jsx Added Teams to startup section (sad day in life!) Updated mpd config (local source) Added script for syncing my music Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated ranger config Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Replaced termite with alacritty Replaced termite by alacritty Updated rsync.sh results Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated github user Updated irc alias Minor changes Added master if fail fait dev* Added zsh prompt Updated output definitions Added KDEConnect at startup Added second screen Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated README Added C.A.V.A. Fixed bug for vte Added Tofu HHKB keyboard config Added script to update system Updated FuzzFm entry Added menu entry for Carnet Added qcad's ebuild Updated waybar for Thinkpad Updated temperature list for Thinkpad Fixed bug Updated input for thinkpad Added script to order files for Alpine car audio system Updated Fuzz url Added Grammalecte plugin Added displays for ThinkStation and ThinkPad Merge branch 'gentoo-sway' of framagit.org:dbroqua/home into gentoo-sway Updated waybar for laptop Fixed bug on adjust brightness Moved applications Co-authored-by: dbroqua <contact@darkou.fr> Co-authored-by: dbroqua <dbroqua@mousur.org> Reviewed-on: https://git.darkou.fr/dbroqua/home/pulls/1 Co-Authored-By: Damien Broqua <dbroqua@noreply.localhost> Co-Committed-By: Damien Broqua <dbroqua@noreply.localhost>
2021-10-21 21:40:47 +02:00
while getopts t:h opt
do
case $opt in
t)
case ${OPTARG} in
usb)
TYPE='usb'
DEST=${DEST_USB}
;;
sshfs)
TYPE='sshfs'
DEST=${DEST_SSHFS}
;;
*)
echo "usb / sshfs attendu"
exit 1;
esac
;;
esac
done
if [ "${TYPE}" != '' ] ; then
case ${TYPE} in
usb)
sudo cryptsetup luksOpen /dev/sdb1 backup
sudo mount /dev/mapper/backup ${MOUNT}
echo "Go !"
if [ $? == 0 ] ; then
${CMD} ${ARGS} ${ORIG} ${DEST}
fi
sudo umount ${MOUNT}
sudo cryptsetup luksClose backup
;;
sshfs)
${CMD} ${ARGS} ${ORIG} ${DEST}
;;
esac
fi
if [ $? == 0 ] ; then
2022-01-25 13:24:57 +01:00
echo `date` > ${ORIG}lastBackup
I3 to Sway (#1) Added some ignored folders and files Updated waybar clock for Debian 11 Fixed bug on screen definition Fixed Iiyama North America PL2483H 1173700204528 Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Some changes for work environment Some changes for work environment Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Added .mp3 files Updated waybar config for laptop Added vim-jsx Added Teams to startup section (sad day in life!) Updated mpd config (local source) Added script for syncing my music Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated ranger config Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Replaced termite with alacritty Replaced termite by alacritty Updated rsync.sh results Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated github user Updated irc alias Minor changes Added master if fail fait dev* Added zsh prompt Updated output definitions Added KDEConnect at startup Added second screen Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated README Added C.A.V.A. Fixed bug for vte Added Tofu HHKB keyboard config Added script to update system Updated FuzzFm entry Added menu entry for Carnet Added qcad's ebuild Updated waybar for Thinkpad Updated temperature list for Thinkpad Fixed bug Updated input for thinkpad Added script to order files for Alpine car audio system Updated Fuzz url Added Grammalecte plugin Added displays for ThinkStation and ThinkPad Merge branch 'gentoo-sway' of framagit.org:dbroqua/home into gentoo-sway Updated waybar for laptop Fixed bug on adjust brightness Moved applications Co-authored-by: dbroqua <contact@darkou.fr> Co-authored-by: dbroqua <dbroqua@mousur.org> Reviewed-on: https://git.darkou.fr/dbroqua/home/pulls/1 Co-Authored-By: Damien Broqua <dbroqua@noreply.localhost> Co-Committed-By: Damien Broqua <dbroqua@noreply.localhost>
2021-10-21 21:40:47 +02:00
echo "Method: ${TYPE}" >> ${ORIG}/lastBackup
2022-01-25 13:24:57 +01:00
rm ${ORIG}lastFailBackup
I3 to Sway (#1) Added some ignored folders and files Updated waybar clock for Debian 11 Fixed bug on screen definition Fixed Iiyama North America PL2483H 1173700204528 Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Some changes for work environment Some changes for work environment Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Added .mp3 files Updated waybar config for laptop Added vim-jsx Added Teams to startup section (sad day in life!) Updated mpd config (local source) Added script for syncing my music Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated ranger config Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Replaced termite with alacritty Replaced termite by alacritty Updated rsync.sh results Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated github user Updated irc alias Minor changes Added master if fail fait dev* Added zsh prompt Updated output definitions Added KDEConnect at startup Added second screen Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated README Added C.A.V.A. Fixed bug for vte Added Tofu HHKB keyboard config Added script to update system Updated FuzzFm entry Added menu entry for Carnet Added qcad's ebuild Updated waybar for Thinkpad Updated temperature list for Thinkpad Fixed bug Updated input for thinkpad Added script to order files for Alpine car audio system Updated Fuzz url Added Grammalecte plugin Added displays for ThinkStation and ThinkPad Merge branch 'gentoo-sway' of framagit.org:dbroqua/home into gentoo-sway Updated waybar for laptop Fixed bug on adjust brightness Moved applications Co-authored-by: dbroqua <contact@darkou.fr> Co-authored-by: dbroqua <dbroqua@mousur.org> Reviewed-on: https://git.darkou.fr/dbroqua/home/pulls/1 Co-Authored-By: Damien Broqua <dbroqua@noreply.localhost> Co-Committed-By: Damien Broqua <dbroqua@noreply.localhost>
2021-10-21 21:40:47 +02:00
else
2022-01-25 13:24:57 +01:00
echo `date` > ${ORIG}lastFailBackup
echo "Method: ${TYPE}" >> ${ORIG}lastFailBackup
I3 to Sway (#1) Added some ignored folders and files Updated waybar clock for Debian 11 Fixed bug on screen definition Fixed Iiyama North America PL2483H 1173700204528 Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Some changes for work environment Some changes for work environment Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Added .mp3 files Updated waybar config for laptop Added vim-jsx Added Teams to startup section (sad day in life!) Updated mpd config (local source) Added script for syncing my music Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated ranger config Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Replaced termite with alacritty Replaced termite by alacritty Updated rsync.sh results Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated github user Updated irc alias Minor changes Added master if fail fait dev* Added zsh prompt Updated output definitions Added KDEConnect at startup Added second screen Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated README Added C.A.V.A. Fixed bug for vte Added Tofu HHKB keyboard config Added script to update system Updated FuzzFm entry Added menu entry for Carnet Added qcad's ebuild Updated waybar for Thinkpad Updated temperature list for Thinkpad Fixed bug Updated input for thinkpad Added script to order files for Alpine car audio system Updated Fuzz url Added Grammalecte plugin Added displays for ThinkStation and ThinkPad Merge branch 'gentoo-sway' of framagit.org:dbroqua/home into gentoo-sway Updated waybar for laptop Fixed bug on adjust brightness Moved applications Co-authored-by: dbroqua <contact@darkou.fr> Co-authored-by: dbroqua <dbroqua@mousur.org> Reviewed-on: https://git.darkou.fr/dbroqua/home/pulls/1 Co-Authored-By: Damien Broqua <dbroqua@noreply.localhost> Co-Committed-By: Damien Broqua <dbroqua@noreply.localhost>
2021-10-21 21:40:47 +02:00
fi