Got something cooked up.
Request the local and remote filelists. And compare them on filesize. (Date is a problem). If they are different I copy the files to an empty dir. And later upload this dir.
#!/bin/sh
rm /hdd/epg/tobeuploaded/*.*
yafc -q <<EOF
open Westland
lcd /hdd/epg/
get -f -n -p *.gz
close
exit
EOF
yafc -q <<EOF3
open kingserver
lcd /media/hdd/epg/
ls -l *.gz > /media/hdd/epg/remote.dir
close
exit
EOF3
cd /hdd/epg/
ls -le *.gz > /media/hdd/epg/local.dir
LOCALFILE=/hdd/epg/local.dir
REMOTE=/hdd/epg/remote.dir
while read line;do
LengteLocal=${line:32:11}
FileName=${line:69:40}
RemoteLine=$(grep -e "$FileName" $REMOTE)
LengteRemote=${RemoteLine:30:11}
if [ $LengteLocal -ne $LengteRemote ] ; then
cp -f /hdd/epg/$FileName /hdd/epg/tobeuploaded/$FileName
fi
done < $LOCALFILE
yafc -q <<EOF2
lcd /hdd/epg/
open WoS
put -np *.gz
close
open VUplus
put -np *.gz
close
lcd /hdd/epg/tobeuploaded
open kingserver
put --force *.gz
close
exit
EOF2
Now I use 2 temp files for storing the localdir and remotedir lists.
I want to do away with these 2 temp files.
Can I do this directly in the bash file? Using a variable?
Problem is of course one of the dirlists is requested using yafc. And storing to a variabel is not working. Or I do not see it.
Willy
Edited by doglover, 28 April 2015 - 14:19.
~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)
Synology NAS
Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*