fixed bug that occured due to commenting out log-function
This commit is contained in:
@@ -1,30 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
IFS=$'\r\n' GLOBIGNORE='*' command eval 'FILES=($(cat backup_filelist.txt))'
|
IFS=$'\r\n' GLOBIGNORE='*' command eval 'FILES=($(cat backup_filelist.txt))'
|
||||||
|
echo `date` >> log.txt
|
||||||
for i in "${FILES[@]}"
|
for i in "${FILES[@]}"
|
||||||
do
|
do
|
||||||
FILENAME=$(basename "$i")
|
FILENAME=$(basename "$i")
|
||||||
if [ -f "$FILENAME" ]; then
|
if [ -f "$FILENAME" ]; then
|
||||||
#echo "$FILENAME exists."
|
#echo "$FILENAME exists." >> log.txt
|
||||||
DIF=$(diff "$i" "$FILENAME")
|
DIF=$(diff "$i" "$FILENAME")
|
||||||
if [ -z "$DIF" ]
|
if [ -z "$DIF" ]
|
||||||
then
|
then
|
||||||
#echo "$FILENAME has not changed, skipping."
|
echo "$FILENAME has not changed, skipping." >> log.txt
|
||||||
else
|
else
|
||||||
#echo "$FILENAME has changed, copying..."
|
echo "$FILENAME has changed, copying..." >> log.txt
|
||||||
cp "$i" .
|
cp "$i" .
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
#echo "$FILENAME does not exist, copying..."
|
echo "$FILENAME is a new file, copying..." >> log.txt
|
||||||
cp "$i" .
|
cp "$i" .
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ `git status --porcelain` ]]; then
|
if [[ `git status --porcelain` ]]; then
|
||||||
#echo "Git reports changes. Perfoming next generic commit."
|
echo "Git reports changes. Perfoming next generic commit." >> log.txt
|
||||||
git add *
|
git add *
|
||||||
git commit -m "next commit"
|
git commit -m "next commit"
|
||||||
else
|
else
|
||||||
#echo "Git doesn't report any changes. No new commit. Exiting."
|
echo "Git doesn't report any changes. No new commit. Exiting." >> log.txt
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
15
log.txt
Normal file
15
log.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
Bestand.xlsx exists.
|
||||||
|
Bestand.xlsx has not changed, skipping.
|
||||||
|
ToDo.xlsx exists.
|
||||||
|
ToDo.xlsx has not changed, skipping.
|
||||||
|
Git doesn't report any changes. No new commit. Exiting.
|
||||||
|
Fr 27 Mai 2022 17:01:20 CEST
|
||||||
|
Bestand.xlsx exists.
|
||||||
|
Bestand.xlsx has not changed, skipping.
|
||||||
|
ToDo.xlsx exists.
|
||||||
|
ToDo.xlsx has not changed, skipping.
|
||||||
|
Git doesn't report any changes. No new commit. Exiting.
|
||||||
|
Fr 27 Mai 2022 17:02:19 CEST
|
||||||
|
Bestand.xlsx has not changed, skipping.
|
||||||
|
ToDo.xlsx has not changed, skipping.
|
||||||
|
Git doesn't report any changes. No new commit. Exiting.
|
||||||
Reference in New Issue
Block a user