msync: Rewrite to use mv/cp instead of rsync
This commit is contained in:
parent
7977f700ba
commit
203c98faf0
@ -14,33 +14,35 @@ done
|
|||||||
MNT="$HOME/quar/mnt"
|
MNT="$HOME/quar/mnt"
|
||||||
ROOT="$MNT/Internal shared storage"
|
ROOT="$MNT/Internal shared storage"
|
||||||
|
|
||||||
# General rsync options
|
imp () {
|
||||||
OPTS="-avPc"
|
find "$1" -type f | xargs -I{} mv {} "$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
exp () {
|
||||||
|
find "$1" -type f| xargs -I{} cp -n {} "$2"
|
||||||
|
}
|
||||||
|
|
||||||
if [ $ACTION = PUSH ]
|
if [ $ACTION = PUSH ]
|
||||||
then
|
then
|
||||||
# Optionally send sorted files back
|
# Optionally send sorted files back
|
||||||
|
|
||||||
rsync $OPTS ~/med/memes/woof/ "$ROOT/Pictures/memes"
|
exp ~/med/memes/woof/ "$ROOT/Pictures/memes/"
|
||||||
rsync $OPTS ~/med/rw/sch/ "$ROOT/Pictures/rw/sch"
|
exp ~/med/rw/sch/ "$ROOT/Pictures/rw/sch/"
|
||||||
rsync $OPTS ~/med/sticker/ "$ROOT/Pictures/sticker"
|
exp ~/med/sticker/ "$ROOT/Pictures/sticker/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Options for all receive rsync transfers
|
|
||||||
ROPTS="--remove-source-files"
|
|
||||||
|
|
||||||
if [ $ACTION = RECV ]
|
if [ $ACTION = RECV ]
|
||||||
then
|
then
|
||||||
# Move files to the quarantine zone for categorisation and renaming
|
# Move files to the quarantine zone for categorisation and renaming
|
||||||
|
|
||||||
rsync $OPTS $ROPTS "$ROOT/Pictures/Infinity/" ~/quar
|
imp "$ROOT/Pictures/Infinity/" ~/quar
|
||||||
|
|
||||||
rsync $OPTS $ROPTS "$ROOT/Movies/Infinity/" ~/quar
|
imp "$ROOT/Movies/Infinity/" ~/quar
|
||||||
|
|
||||||
rsync $OPTS $ROPTS "$ROOT/DCIM/OpenCamera/" ~/quar
|
imp "$ROOT/DCIM/OpenCamera/" ~/quar
|
||||||
rsync $OPTS $ROPTS "$ROOT/DCIM/Camera/" ~/quar
|
imp "$ROOT/DCIM/Camera/" ~/quar
|
||||||
|
|
||||||
rsync $OPTS $ROPTS "$ROOT/Recordings/Sound records/" ~/quar
|
imp "$ROOT/Recordings/Sound records/" ~/quar
|
||||||
|
|
||||||
rsync $OPTS $ROPTS "$ROOT/Documents/dr" ~/quar
|
imp "$ROOT/Documents/dr" ~/quar
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user