Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 22/04/2006, à 20:29

administrateur_linux

System de sauvegarde sur HDD USB

Bonsoir,

Je cherche une solution de sauvegarde sur HDD usb, j'ai utilisé dar et son fronten Kdar, sa me satifais pas correctement surtous que on va chercher des fichiers manuellement.

J'ai entendu parler de Rsync, mai j'arrive pas a le métrisé au niveaux des otpions.

si vous avez des solution... a vos clavier...:D

Hors ligne

#2 Le 23/04/2006, à 09:11

Bobbybionic

Re : System de sauvegarde sur HDD USB

Bonjour
J'utilisais ce petit script sans prétention :

#!/bin/bash
echo "1. Lancer la sauvegarde du home"
echo "2. Lancer la sauvegarde du système"
read reponse
case $reponse in
	1)
	rm `find /home/guillaume/ -name "*.*~"`
	rsync -ra --progress --delete /home/guillaume/ /media/fichiers/BACKUP/home/guillaume/
	;;
	2)
	sudo rsync -ra --progress --delete / /media/fichiers/BACKUP/
	;;
esac
echo "Sauvegarde terminée !"
sleep 5

Non à la vente liée. Non au monopole Windows.
Tous ensemble, refusons les logiciels préinstallés et tournons nous vers le libre.

http://bobbybionic.wordpress.com

Hors ligne

#3 Le 23/04/2006, à 22:13

administrateur_linux

Re : System de sauvegarde sur HDD USB

Merci pour le script, peut-tu m'expliquer les otions de Rsync ?

rsync -ra --progress --delete

Hors ligne

#4 Le 24/04/2006, à 09:21

Bobbybionic

Re : System de sauvegarde sur HDD USB

man rsync a écrit :

-a, --archive
              This  is equivalent to -rlptgoD. It is a quick way of saying you
              want recursion and want to preserve almost everything.  The only
              exception  to  this  is  if --files-from was specified, in which
              case -r is not implied.

              Note that -a does not preserve hardlinks, because finding multi‐
              ply-linked  files is expensive.  You must separately specify -H.

-r, --recursive
              This tells rsync to  copy  directories  recursively.   See  also
              --dirs (-d).

--delete
              This  tells  rsync to delete extraneous files from the receiving
              side (ones that aren’t on the sending side), but  only  for  the
              directories  that  are  being synchronized.  You must have asked
              rsync to send the whole directory (e.g. "dir" or "dir/") without
              using  a  wildcard  for  the directory’s contents (e.g. "dir/*")
              since the wildcard is expanded by the shell and rsync thus  gets
              a  request  to  transfer individual files, not the files’ parent
              directory.  Files that  are  excluded  from  transfer  are  also
              excluded from being deleted unless you use the --delete-excluded
              option or mark the rules as only matching on  the  sending  side
              (see the include/exclude modifiers in the FILTER RULES section).

              This option has no effect unless directory recursion is enabled.

              This  option can be dangerous if used incorrectly!  It is a very
              good idea to run first using the --dry-run option  (-n)  to  see
              what  files would be deleted to make sure important files aren’t
              listed.

              If the sending side detects any I/O errors, then the deletion of
              any  files  at  the  destination will be automatically disabled.
              This is to prevent temporary filesystem failures  (such  as  NFS
              errors)  on the sending side causing a massive deletion of files
              on  the  destination.   You   can   override   this   with   the
              --ignore-errors option.

              The   --delete   option   may   be  combined  with  one  of  the
              --delete-WHEN   options   without   conflict,   as    well    as
              --delete-excluded.    However,  if  none  of  the  --delete-WHEN
              options  are  specified,  rsync  will   currently   choose   the
              --delete-before  algorithm.  A future version may change this to
              choose the --delete-during algorithm.  See also  --delete-after.

--progress
              This  option  tells  rsync  to  print  information  showing  the
              progress  of  the transfer. This gives a bored user something to
              watch.  Implies --verbose if it wasn’t already specified.

              When the file is transferring, the data looks like this:

                    782448  63%  110.64kB/s    0:00:04

              This tells you the current file  size,  the  percentage  of  the
              transfer  that  is complete, the current calculated file-comple‐
              tion rate (including both data over  the  wire  and  data  being
              matched  locally),  and  the  estimated  time  remaining in this
              transfer.

              After a file is complete, the data looks like this:

                   1238099 100%  146.38kB/s    0:00:08  (5, 57.1% of 396)

              This tells you the final file size, that it’s 100% complete, the
              final  transfer rate for the file, the amount of elapsed time it
              took to transfer the file, and the addition of a  total-transfer
              summary  in  parentheses.  These additional numbers tell you how
              many files have been updated, and  what  percent  of  the  total
              number of files has been scanne

En gros : r pour la récursivité (il synchronise aussi les sous répertoires), a je sais plus pourquoi big_smile mais ça ne davait pas marcher sans, je n'ai pas pris le temps de bien lire le man, la réponse est peut être évidente, progress pour voir la progression (il affiche ce qu'il copie et mets un pourcentage, pas mal quand on synchronise 40Go, delete pour supprimer les fichiers obsolètes (qui n'apparaissent plus dans la sources, mais sont encore dans la destination).

Ainsi, on obtient la copie conforme de son home ou de sa racine.


Non à la vente liée. Non au monopole Windows.
Tous ensemble, refusons les logiciels préinstallés et tournons nous vers le libre.

http://bobbybionic.wordpress.com

Hors ligne

#5 Le 24/04/2006, à 09:43

cep_

Re : System de sauvegarde sur HDD USB

Voir : http://www.mikerubel.org/computers/rsync_snapshots/

et : rsync -a source/ destination/

(Note: I usually also add the -v (verbose) flag too so that rsync tells me what it's doing). This command is equivalent to:

cp -a source/. destination/

except that it's much more efficient if there are only a few differences.

De même :  http://www.lalitte.com/rsync.html