Spaces:
Runtime error
Runtime error
Commit
·
e7fb5d3
1
Parent(s):
d287b55
chore: Update start_server.sh to only copy notebooks if they have changed
Browse files- start_server.sh +7 -4
start_server.sh
CHANGED
|
@@ -6,7 +6,7 @@ if [ ! -d /data ]; then
|
|
| 6 |
sudo chown user:user /data
|
| 7 |
fi
|
| 8 |
|
| 9 |
-
# Copy notebooks to /data, appending _UPDATED to filenames if they
|
| 10 |
shopt -s globstar
|
| 11 |
for file in /home/user/notebooks/**/*; do
|
| 12 |
if [ -f "$file" ]; then
|
|
@@ -17,10 +17,13 @@ for file in /home/user/notebooks/**/*; do
|
|
| 17 |
mkdir -p "$target_dir"
|
| 18 |
fi
|
| 19 |
if [ -e "$target_file" ]; then
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
fi
|
| 23 |
-
cp "$file" "$target_file"
|
| 24 |
fi
|
| 25 |
done
|
| 26 |
|
|
|
|
| 6 |
sudo chown user:user /data
|
| 7 |
fi
|
| 8 |
|
| 9 |
+
# Copy notebooks to /data, appending _UPDATED to filenames if they have changed
|
| 10 |
shopt -s globstar
|
| 11 |
for file in /home/user/notebooks/**/*; do
|
| 12 |
if [ -f "$file" ]; then
|
|
|
|
| 17 |
mkdir -p "$target_dir"
|
| 18 |
fi
|
| 19 |
if [ -e "$target_file" ]; then
|
| 20 |
+
if ! cmp -s "$file" "$target_file"; then
|
| 21 |
+
new_filename="${target_file%.*}_UPDATED.${target_file##*.}"
|
| 22 |
+
cp "$file" "$new_filename"
|
| 23 |
+
fi
|
| 24 |
+
else
|
| 25 |
+
cp "$file" "$target_file"
|
| 26 |
fi
|
|
|
|
| 27 |
fi
|
| 28 |
done
|
| 29 |
|