40 lines
822 B
Bash
40 lines
822 B
Bash
#!/usr/bin/env bash
|
|
|
|
##-----------------##
|
|
# Static-Vars #
|
|
##-----------------##
|
|
source session-name #importing sessions
|
|
source session-mode
|
|
source script-statvars
|
|
echo "script_location"
|
|
|
|
|
|
source "$backup_location/session-count"
|
|
import_prefix=import"$sessioncount"
|
|
|
|
##-------------##
|
|
# Running #
|
|
##-------------##
|
|
|
|
cd "$card_mount"
|
|
|
|
for f in *
|
|
do
|
|
echo "$f" "$backup_location"/"$import_prefix"_"$f"
|
|
cp -r "$f" "$backup_location"/"$import_prefix"_"$f"
|
|
filecpcounter=$(expr "$filecpcounter" + "1")
|
|
echo filecpcounter="$filecpcounter" > "$script_location"/session-cpcounter
|
|
done
|
|
|
|
cd "$script_location"
|
|
|
|
source session-cpcounter
|
|
echo "Items transferred: $filecpcounter"
|
|
|
|
if [ $backupmode == dumpmove ]; then
|
|
rm -rf $card_mount/*
|
|
echo "removing files"
|
|
fi
|
|
|
|
umount "$card_mount"
|
|
echo "curstate=2" > session-state |