Added CreateFileList
This commit is contained in:
parent
594d6fb157
commit
186070cd24
@ -95,8 +95,29 @@ VerboseOutput() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CreateFileList() {
|
||||||
|
# ${1} /mnt/hdd/Example-Artist/Example-Album
|
||||||
|
# ${2} /mnt/mtp/Example-Artist/Example-Album
|
||||||
|
# ${3} Example-Artist/Example-Album/
|
||||||
|
IFS=""
|
||||||
|
sourcepath="${1}/*"
|
||||||
|
for file in $sourcepath; do
|
||||||
|
relfile="${file#"$1/"}"
|
||||||
|
if [[ -d "${1}/$relfile" ]]; then
|
||||||
|
newdir="${3}/$relfile"
|
||||||
|
newdir=${newdir#"/"}
|
||||||
|
VerboseOutput "Info" "Entering $newdir"
|
||||||
|
CreateFileList "${1}/$relfile" "${2}/$relfile" "$newdir"
|
||||||
|
elif [[ ! -f "${2}/$relfile" || "${2}/$relfile" -nt "${1}/$relfile" ]]; then
|
||||||
|
echo ${3}/$relfile >> /tmp/music-sync-filelist
|
||||||
|
VerboseOutput "Info" "Added: ${3}/${relfile}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
GetOptions $@
|
GetOptions $@
|
||||||
if [[ "$help" == true ]]; then
|
if [[ "$help" == true ]]; then
|
||||||
Usage
|
Usage
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
CreateFileList $source $dest ""
|
Loading…
Reference in New Issue
Block a user