AtOM/lib/copy/copyFile
2013-04-07 01:27:07 +02:00

29 lines
760 B
Plaintext

copyFile() {
extension="${filename##*.}"
cp -al \
"$sourcepath/$filename" \
"$destdir/$destfile.$extension" \
2>/dev/null \
|| cp -a \
"$sourcepath/$filename" \
"$destdir/$destfile.$extension"
echo \
"UPDATE destination_files" \
"SET filename=\"${filename//\"/\"\"}\"," \
" last_change=(" \
" SELECT last_change" \
" FROM source_files" \
" WHERE id=$fileid" \
" )," \
" old_filename=(" \
" SELECT filename" \
" FROM destination_files" \
" WHERE id=$destfileid" \
" )," \
" rename_pattern=" \
"\"${destinationrenamepath[$destination]}/${destinationrename[$destination]}:${destinationfat32compat["$destination"]}\""\
"WHERE id=$destfileid;" \
>&3
(( ++copies ))
}