Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Sincronizzare con ftp

  1. #1

    Sincronizzare con ftp

    Devo sincronizzare una cartella locale con un servizio ftp esterno ogni 5min.
    Conoscete qualche programma ho sentito parlare di mirror ma non ho trovato niente di simile in source forge e co.
    Per me è molto importante vi rignrazio in anticipo.
    Ciao
    Davide

  2. #2

    Synch..

    Puoi usare rsync( http://samba.anu.edu.au/rsync/ ), dai un occhiata a questi esempi: http://samba.anu.edu.au/rsync/examples.html . Oppure puoi usare l'accoppiata wget && crontab. ti incollo uno script che uso, magari ti può essere utile come esempio.


    codice:
    #!/bin/sh 
    
    # When run, this script will generate a mirror of the PuTTY website
    # in a subdirectory called `putty'.
    
    # Fetch the main web site.
    wget --no-parent -l0 -r --cut-dirs=1 -nH \
    	http://www.chiark.greenend.org.uk/~sgtatham/putty/
    
    # Fetch the .htaccess file from the download site, in order to find the
    # version number of the latest release.
    cd putty
    wget http://the.earth.li/~sgtatham/putty/htaccess
    version=`sed -n 's!.*http://the.earth.li/~sgtatham/putty/\(.*\)/!\1!p' htaccess`
    echo Latest version is $version
    
    # Retrieve the binaries directory for that version from the binaries
    # server.
    wget --no-parent -l0 -r --cut-dirs=3 -P $version -nH \
    	http://the.earth.li/~sgtatham/putty/$version/
    
    # Fix the hyperlinks in the download and docs pages so that they point
    # to the local mirror of the binaries instead of the primary binaries
    # server. Without this there's barely any point in doing the mirror at
    # all.
    perl -i~ -pe 's!http://the.earth.li/~sgtatham/putty/!!' download.html docs.html
    
    # Create a .htaccess file that supplies the redirection from
    # "latest" to a numbered version directory. This RedirectMatch
    # command ought to do that job independently of the 
    echo "RedirectMatch temp ^(.*)/latest(/[^/]*/?[^/]*)?$ \$1/$version\$2" > .htaccess
    
    # The .htaccess file should also ensure the Windows Help files are
    # not given any strange MIME types by the web server. Also it
    # should make sure the GPG signatures have the correct MIME type.
    echo "AddType application/octet-stream .hlp" >> .htaccess
    echo "AddType application/octet-stream .cnt" >> .htaccess
    echo "AddType application/octet-stream .RSA" >> .htaccess
    echo "AddType application/octet-stream .DSA" >> .htaccess
    Saluti,
    Gianluca Varisco
    http://www.gxware.org - giangy@gxware.org

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.