Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 12
  1. #1

    Due directory sincronizzate?

    Sto allestendo un sistema di backup per un ufficio.

    La situazione è questa, loro hanno un hard-disk esterno USB (20 Gb), un Caca-Pc ed un Server Linux.

    Per ora ho messo una scheda USB2 sul Caca-Pc, ci ho messo sopra linux (Debian Sid) e ci ho attaccato l'hard-disk esterno; linux monta l'hard-disk nella directory /mnt/usbdisk e, tramite samba, condivide tramite rete windows le varie cartelle.
    Il serve, invece, ha sopra un gestionale su Redhat 7.3 ed ovviamente Samba; lo spazio libero è di oltre 20 Gb (hard-disk da 40 Gb).

    Ora la mia idea era di scrivere un programmino sul caca-pc che monta tramite samba la cartella del Server Linux, ad esempio nella directory /mnt/server.

    Mettiamo che, inizialmente, copio nelle due cartelle, gli stessi documenti, esiste un programma per sincronizzare i dati della cartella /mnt/server ed /mnt/usbdisk?
    Cioe' se creo automaticamente un file in /mnt/usbdisk, me lo copia automaticamente (e nella medesima posizione) in /mnt/server? (e viceversa)

    [Homepage] [Contattami]
    Powered by: Ubuntu - Debian - Gentoo
    Developing: Java - C++ - PHP

    [supersaibal]"Perchè tanto Debian è meglio"
    [/supersaibal]

  2. #2
    Sta cosa interessa anche a me... non saprei risponderti, però stavo pensando una cosa, se prevedessi una copia (magari notturna) dell'intero hd sull'altro tramite uno script che utilizza il comando scp? Certo però che hai parecchi gb da copiare...

  3. #3
    Originariamente inviato da wierzbowsky
    Sta cosa interessa anche a me... non saprei risponderti, però stavo pensando una cosa, se prevedessi una copia (magari notturna) dell'intero hd sull'altro tramite uno script che utilizza il comando scp? Certo però che hai parecchi gb da copiare...
    Avevo pensato ad una cosa molto più pratica, del tipo faccio un programma in bash o in java (che manipola molto bene i file) che mi crea la lista completa delle directory e file (con relativa data di modifica), ad esempio

    #/mnt/usbdisk
    doc1.doc
    immagini/pinco.gif
    template/prova.pdf

    #/mnt/server
    doc1.doc
    immagini/pinco.gif
    porno/gangbang.mpg

    Poi tramite un algoritmo di ricerca elimino dalle due liste i doppioni in modo da avere, per ogni directory i file nuovi presenti, ad esempio

    #/mnt/usbdisk
    template/prova.pdf

    #/mnt/server
    porno/gangbang.mpg

    a quel punto dico al programma di copiare prova.pdf da usbdisk a server (creando le directory se necessario) e gangbang.mpg da server a usbdisk.

    Dovrebbe funzionare! credo!
    [Homepage] [Contattami]
    Powered by: Ubuntu - Debian - Gentoo
    Developing: Java - C++ - PHP

    [supersaibal]"Perchè tanto Debian è meglio"
    [/supersaibal]

  4. #4

    Re: Due directory sincronizzate?

    Originariamente inviato da virusbye
    esiste un programma per sincronizzare i dati della cartella /mnt/server ed /mnt/usbdisk?
    rsync (magari in cronjob) puo` essere di aiuto?
    "Qualsiasi esperto ha paura di combattere usando la katana vera. Anch'io. Ma non ignoro la mia paura, riesco ad accettarla, e a metterla da parte accanto a me".

  5. #5
    Si, in effetti è molto meno brutale (anche se un po' piu' complesso da realizzare). Potresti anche solo copiare i files che hanno come data di modifica quella del giorno (dopo aver fatto naturalmente una prima copia del disco).

  6. #6

    Re: Re: Due directory sincronizzate?

    Originariamente inviato da Ikitt
    rsync (magari in cronjob) puo` essere di aiuto?
    che fa esattamente?
    [Homepage] [Contattami]
    Powered by: Ubuntu - Debian - Gentoo
    Developing: Java - C++ - PHP

    [supersaibal]"Perchè tanto Debian è meglio"
    [/supersaibal]

  7. #7

    Re: Re: Re: Due directory sincronizzate?

    Originariamente inviato da virusbye
    che fa esattamente?
    da man rsync:
    DESCRIPTION
    rsync is a program that behaves in much the same way that rcp does, but
    has many more options and uses the rsync remote-update protocol to
    greatly speed up file transfers when the destination file already
    exists.

    The rsync remote-update protocol allows rsync to transfer just the dif-
    ferences between two sets of files across the network link, using an
    efficient checksum-search algorithm described in the technical report
    that accompanies this package.

    Some of the additional features of rsync are:

    o support for copying links, devices, owners, groups and permis-
    sions

    o exclude and exclude-from options similar to GNU tar

    o a CVS exclude mode for ignoring the same files that CVS would
    ignore

    o can use any transparent remote shell, including rsh or ssh

    o does not require root privileges

    o pipelining of file transfers to minimize latency costs

    o support for anonymous or authenticated rsync servers (ideal for
    mirroring)

    [...]

    USAGE
    You use rsync in the same way you use rcp. You must specify a source
    and a destination, one of which may be remote.

    Perhaps the best way to explain the syntax is some examples:

    rsync *.c foo:src/

    this would transfer all files matching the pattern *.c from the current
    directory to the directory src on the machine foo. If any of the files
    already exist on the remote system then the rsync remote-update proto-
    col is used to update the file by sending only the differences. See the
    tech report for details.

    rsync -avz foo:src/bar /data/tmp

    this would recursively transfer all files from the directory src/bar on
    the machine foo into the /data/tmp/bar directory on the local machine.
    The files are transferred in "archive" mode, which ensures that sym-
    bolic links, devices, attributes, permissions, ownerships etc are pre-
    served in the transfer. Additionally, compression will be used to
    reduce the size of data portions of the transfer.

    rsync -avz foo:src/bar/ /data/tmp

    a trailing slash on the source changes this behavior to transfer all
    files from the directory src/bar on the machine foo into the
    /data/tmp/. A trailing / on a source name means "copy the contents of
    this directory". Without a trailing slash it means "copy the direc-
    tory". This difference becomes particularly important when using the
    --delete option.

    You can also use rsync in local-only mode, where both the source and
    destination don't have a ':' in the name. In this case it behaves like
    an improved copy command.

    rsync somehost.mydomain.com::

    this would list all the anonymous rsync modules available on the host
    somehost.mydomain.com. (See the following section for more details.)
    "Qualsiasi esperto ha paura di combattere usando la katana vera. Anch'io. Ma non ignoro la mia paura, riesco ad accettarla, e a metterla da parte accanto a me".

  8. #8
    rsync sarebbe perfetto ma non usa data encryption (non so se ne hai bisogno). Qui ho trovato uno script di backup con rsync e ssh, forse ti può servire.

  9. #9
    io lo sto usando per sincronizzare il mio computer di casa con il portatile dell'ufficio.
    Voglio usare samba o Nfs,rsync,cron , tanta bash e tante buone tazze di caffè.
    Sto facendo un programmino lato server con cron che ciclicamente controlla se la macchina esiste ... e da solo sincronizza le home !
    Idee ?? Potremmo fare qualcosa assime !
    I have tried all ... but the preferred remains SLACKWARE !
    RHCE (Linux Red Hat Certified Engineer)
    CNAC (Cisco Networking Academy Certified)
    "Non auro, sed ferro, recuperanda est patria"

  10. #10
    Originariamente inviato da Boromir
    io lo sto usando per sincronizzare il mio computer di casa con il portatile dell'ufficio.
    Voglio usare samba o Nfs,rsync,cron , tanta bash e tante buone tazze di caffè.
    Sto facendo un programmino lato server con cron che ciclicamente controlla se la macchina esiste ... e da solo sincronizza le home !
    Idee ?? Potremmo fare qualcosa assime !

    Hai dato un'occhiata al link che ho postato? Mi sembra un'ottima soluzione, oltretutto con connessione sicura, che ne dici?

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 © 2025 vBulletin Solutions, Inc. All rights reserved.