Linux Question: compare files AKA Backup FTP Script

Date 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! ;-)

6 Responses to “Linux Question: compare files AKA Backup FTP Script”

  1. pof said:

    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

  2. Pax Pacis said:

    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..

  3. dennis said:

    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

  4. dennis said:

    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

  5. Robbie72 said:

    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…

  6. dennis said:

    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

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

After submitting a comment you can MODIFY it again by clicking the message or name

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word