diff options
author | David Walter Seikel | 2016-11-27 23:58:40 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-27 23:58:40 +1000 |
commit | ed0de24e6bc2cac4c20051070710557055b463d0 (patch) | |
tree | 888f55c8f7317f96cc00450f886c9d52ac64e8ef /scripts/gitAR.sh | |
parent | Fix "only backup people that have logged in since last time", due to OpenSim ... (diff) | |
download | opensim-SC-ed0de24e6bc2cac4c20051070710557055b463d0.zip opensim-SC-ed0de24e6bc2cac4c20051070710557055b463d0.tar.gz opensim-SC-ed0de24e6bc2cac4c20051070710557055b463d0.tar.bz2 opensim-SC-ed0de24e6bc2cac4c20051070710557055b463d0.tar.xz |
Various little backup system fixes.
Diffstat (limited to '')
-rwxr-xr-x | scripts/gitAR.sh | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/scripts/gitAR.sh b/scripts/gitAR.sh index 25cab48..bbcc761 100755 --- a/scripts/gitAR.sh +++ b/scripts/gitAR.sh | |||
@@ -51,18 +51,25 @@ cat >.gitattributes <<- zzzzEOFzzzz | |||
51 | *.r32 -delta -diff -text | 51 | *.r32 -delta -diff -text |
52 | *.tga -delta -diff -text | 52 | *.tga -delta -diff -text |
53 | zzzzEOFzzzz | 53 | zzzzEOFzzzz |
54 | git add .gitattributes &>>../log | ||
55 | # Coz git insists. | 54 | # Coz git insists. |
56 | git config user.email "opensim@$(hostname -A | cut -d ' ' -f 1)" | 55 | git config user.email "opensim@$(hostname -A | cut -d ' ' -f 1)" |
57 | git config user.name "opensim" | 56 | git config user.name "opensim" |
58 | 57 | ||
58 | # Git is such a pedantic bitch, let's just fucking ignore any errors it gives due to lack of anything to do. | ||
59 | # Even worse the OpenSim devs breaking logout tracking gives git plenty of nothing to do. lol | ||
60 | |||
59 | # Looping through them in case there's a bunch of I/OARs from previous versions of this script. | 61 | # Looping through them in case there's a bunch of I/OARs from previous versions of this script. |
60 | find ../.. -maxdepth 1 -type f -name ${name}-*.${type}ar | sort | while read file; do | 62 | # Ignore files of zero size that OpenSim might create. |
63 | find ../.. -maxdepth 1 -type f -name "${name}-*.${type}ar" -size '+0c' | sort | while read file; do | ||
61 | # Deal with deletions in the inventory / sim, easy method, which becomes a nop for files that stay in the git add below. | 64 | # Deal with deletions in the inventory / sim, easy method, which becomes a nop for files that stay in the git add below. |
62 | git rm -fr * &>>../log && \ | 65 | git rm -fr * &>>../log #|| echo "ERROR - Could not clean git for ${file} !" >>../errors |
63 | nice -n 19 tar -xzf "${file}" || echo "ERROR - Could not unpack ${file} !" >>../errors | 66 | if [ ! -f ../errors ]; then |
67 | nice -n 19 tar -xzf "${file}" || echo "ERROR - Could not unpack ${file} !" >>../errors | ||
68 | fi | ||
64 | if [ ! -f ../errors ]; then | 69 | if [ ! -f ../errors ]; then |
65 | git add * &>>../log && git add */\* &>>../log | 70 | git add * &>>../log |
71 | git add */\* &>>../log #|| echo "ERROR - Could not add ${file} to git!" >>../errors | ||
72 | git add .gitattributes &>>../log | ||
66 | # Magic needed to figure out if there's anything to commit. | 73 | # Magic needed to figure out if there's anything to commit. |
67 | # After all the pain to get this to work, there's an ever changing timestamp in archive.xml that screws it up. | 74 | # After all the pain to get this to work, there's an ever changing timestamp in archive.xml that screws it up. |
68 | # Like this system didn't have enough timestamps in it already. lol | 75 | # Like this system didn't have enough timestamps in it already. lol |
@@ -99,5 +106,3 @@ if [ -f ${PRGDIR}/../../backups/temp_backup${type}_${name}/errors ]; then | |||
99 | else | 106 | else |
100 | rm -fr ${PRGDIR}/../../backups/temp_backup${type}_${name} | 107 | rm -fr ${PRGDIR}/../../backups/temp_backup${type}_${name} |
101 | fi | 108 | fi |
102 | |||
103 | echo -n ${name} | ||