Linux Question: compare files AKA Backup FTP Script
March 27, 2008
update .. my newbie geek linux backup script is here what is wrong? Anyone like to help further? Maybe I can learn from it
PLEASE HELP! ;-)

March 27, 2008 update .. my newbie geek linux backup script is here what is wrong? Anyone like to help further? Maybe I can learn from it
PLEASE HELP! ;-)
March 28th, 2008 at 12:09 am
You can for example check only sizes and time of the last modification for each file, this would be much quicker and probably fit your needs:
du -a –time $FOLDER1 > /tmp/folder1
du -a –time $FOLDER2 > /tmp/folder2
diff /tmp/folder1 /tmp/folder2
March 28th, 2008 at 9:34 am
Maybe you can use rsync?
You can use rsynch to make the 2 directories the same if that is your goal..
rsync -av –delete /home/backup/ch3snas/ /home/backup/server/data
the –delete make sure the files that are deleted in the source are also deleted in the target so the target will not grow out of diskspace.
rsync has a lot more options ofcourse..
March 28th, 2008 at 11:57 am
rsync itself for the purpose is too slow
my ’script’ already works, but need to compare the target folder with the source if they are equal, if they are equal than the source files can be removed if not (due to failure in ftp) than the script must stop
March 28th, 2008 at 7:08 pm
FOLDER1=$’/home/backup/server/data’
FOLDER2=$’/home/backup/ch3snas/`date “+%d-%m-%y”`’
du -a .time $FOLDER1 > /tmp/folder1
du -a .time $FOLDER2 > /tmp/folder2
Compare=$(diff /tmp/folder1 /tmp/folder2)
FOLDER2 does not work as I want it. Folder2 has the date of today, and this folder must be compared, but the date command seems not to work as environment
May 12th, 2008 at 6:50 pm
Dennis,
Kan het mis hebben, maar mis je niet 1x else ????
In het begin 2x if then, naar na wat commando’s maar 1x else….
Je mist de else van if [ ! -n "$Compare" ]; then
of van if [ -e data ] then
volgens mij…
May 23rd, 2008 at 6:49 pm
Hi Robbie, thanks for your answer
I have solved my issue by buying a script for bluequartz..
that was more easy than all the hassle I had to do myself programming