issue83:sauvegardes
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue83:sauvegardes [2014/05/11 18:12] – andre_domenech | issue83:sauvegardes [2014/09/16 17:52] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | TITRE / Effective Backups In Ubuntu | + | **TITRE / Effective Backups In Ubuntu** |
- | Don’t worry Python fans. Greg will be back next month. | + | TITRE / Des sauvegardes efficaces avec Ubuntu |
+ | **Don’t worry Python fans. Greg will be back next month.** | ||
- | One of the constants in the history of desktop computing is disk prices going down over time in terms of money for the MByte. As a consequence (or is it perhaps a cause?), our disk usage for work or play has also gone steadily up. Since a large part of our digital lives could eventually be wiped out in the event of drive failure, a lot of attention has been given to the backing up of personal documents, photo libraries, music collections and other pieces of data. | + | Fans de Python : ne vous inquiétez pas... Greg sera de retour le mois prochain. |
- | But not all backup strategies are equal. In the first place, it must be easy for us to make backups. Otherwise, experience shows we will not make them at all. A perfect three-tiered backup strategy that guarantees no data loss if used correctly | + | **One of the constants in the history of desktop computing is disk prices going down over time in terms of money for the MByte. As a consequence (or is it perhaps a cause?), our disk usage for work or play has also gone steadily up. Since a large part of our digital lives could eventually be wiped out in the event of drive failure, a lot of attention has been given to the backing up of personal documents, photo libraries, music collections and other pieces of data.** |
- | On the other hand, a backup strategy also needs to take into account the limitations of hardware as regards space and time. Most cloud-based services are limited to about 5 GBytes of space. But filling this up from the Internet over a 1 Mbit/s asymmetrical link may take up to 37 hours of continuous uploading | + | Dans l' |
- | Finally, a good backup | + | **But not all backup |
- | Fortunately enough, Ubuntu has some tips and tricks that makes it an easy operating system to back up, rather more so in fact than some others. Let’s review some of the more accessible practices. | + | Mais toutes les stratégies de sauvegarde ne se valent pas. En premier lieu, réaliser une sauvegarde doit être quelque chose de facile, sinon nous ne le ferions pas. Une stratégie de sauvegarde à trois niveaux qui garantit la conservation des données s’avérera inutile si elle n'est pas utilisée parfaitement - aussi fiable soit-elle ; notamment si elle son interface est peu conviviale et l' |
- | Cloud-based | + | **On the other hand, a backup strategy also needs to take into account the limitations of hardware as regards space and time. Most cloud-based |
- | Cloud-based storage is the current fad in home (and, up to a point, business) desktop computing. You place your documents in a certain folder (for services | + | D' |
- | However, when using this type of service, we should | + | **Finally, a good backup strategy must also be flexible: we need to plan for the worst, which could mean having to scrap our system completely and simply get a new one. But we will then need to get our data back on again, and usually in a bit of a hurry. Disaster almost never strikes at the most convenient time.** |
- | Depending on the type of information we store, this may or may not be a problem. To take an example, should a general practitioner store his/her patients’ medical data in the cloud? Depending on applicable law, it may be prudent to – at the very least – encrypt the data files before uploading them to a server that the user has no direct control of. | + | Enfin, une bonne stratégie de sauvegarde doit également être souple : nous devons prévoir le pire, ce qui pourrait signifier avoir à abandonner notre machine complètement et en obtenir une nouvelle. Mais nous aurons alors besoin de retrouver rapidement nos données : la catastrophe n' |
- | Taking these elements into account, a reasonable cloud-based backup strategy will probably focus only on documents, not other types of media. Of these, perhaps only part of the user’s documents will be backed up, but not all. | + | **Fortunately enough, Ubuntu has some tips and tricks that makes it an easy operating system to back up, rather more so in fact than some others. Let’s review some of the more accessible practices.** |
- | Whatever strategy we apply will probably use the existing | + | Heureusement, |
- | For example, we could create a BackupedImages subdirectory within Pictures | + | **Cloud-based storage** |
- | mkdir ~/ | + | Stockage dans le nuage |
- | that we could then create a (soft) link to in the Dropbox | + | **Cloud-based storage is the current fad in home (and, up to a point, business) desktop computing. You place your documents |
- | cd ~/Dropbox | + | Le stockage en nuage est actuellement à la mode concernant notre bureautique à la maison (et, jusqu' |
- | ln -s ~/ | + | **However, when using this type of service, we should also be aware of several caveats. As mentioned above, space is limited on the cloud and transfer times tend to be slow. This limits severely its use for storing common data items such as large photo libraries or music collections, |
- | Any files placed or modified in Pictures/ | + | Cependant, en utilisant ce type de service, nous devrions aussi être conscients de plusieurs mises en garde. Comme mentionné ci-dessus, l' |
- | Naturally, this scheme will need to be replicated on the other machines we use to make these documents available to them as well. When doing so, it is best to pause Dropbox syncing before creating the directory and link, and start it up back again later. | ||
- | This also applies to similar services such as Canonical’s Ubuntu One. However, in this particular case, you will need to use One’s control panel to add the different folders you want to backup, as directly creating | + | **Depending on the type of information we store, this may or may not be a problem. To take an example, should a general practitioner store his/her patients’ medical data in the cloud? Depending on applicable law, it may be prudent |
- | It may be tempting to include the Desktop itself within the backup scheme. However, some people use our Desktop as a temporary work zone. We tend to hammer our files quite hard, e.g. while compiling programs, so we would not want each and every file change to be reflected up into the cloud clogging up our Internet access in the process. In such cases, it is best to do our work in another directory, and then copy files into the backup zone when they have reached | + | Selon le type d' |
- | Backing | + | **Taking these elements into account, a reasonable cloud-based backup strategy will probably focus only on documents, not other types of media. Of these, perhaps only part of the user’s documents will be backed |
- | External drives are relatively cheap nowadays. Many USB-connected models can be found either in the 2½“ form factor, or in 3½” form. In the first case, the enclosure will contain a disk drive designed for laptops and that can usually run on 5V power supplied directly by the computer through the USB cable. In the second, it will contain a drive designed for desktop computers, that needs both 5V and 12V power, and so will require an additional power brick (transformer). If you need compactness and wish to minimize cabling, go for the first. If you need large capacities (above 1.5 TByte and up to 3 TByte), the second type will fulfill your needs better. | + | Fort de ces éléments, une stratégie de sauvegarde raisonnable dans le nuage consistera probablement à se concentrer uniquement sur les documents et pas sur les autres types de médias. Parmi ceux-ci, peut-être qu'une partie des documents de l' |
- | Besides | + | **Whatever strategy we apply will probably use the existing Ubuntu directory structure at some point. Most applications are already tuned to the default ~/Documents, ~/Images, ~/Downloads, etc ... directories, so we might as well use them. But on the other hand, the cloud service will be based on a single folder, for example ~/ |
- | Whichever connection type you use, performance depends on both factors, the disk and the connection. It is important for the actual use of backups. Nobody wants to wait half an hour for some videos to be copied over, when, with another setup, five minutes might suffice. | + | Quelle que soit la stratégie que nous appliquons nous allons probablement utiliser la structure de répertoires d' |
- | The Disks applet (gnome-disk) comes as standard on current Ubuntu distributions, and has several utilities built-in. One, the benchmark, can measure several interesting performance parameters for hard disks. Two screen captures are included here, both created with the same USB 2 adaptor but using different hard drives. | + | **For example, we could create a BackupedImages subdirectory within Pictures** |
- | In the first (top left), we can see how a standard 500 GByte spinning platter hard drive - natively capable of reading and writing at about 100 MByte/s - is limited to 33 MByte/s reading and 20 MByte/s writing when connected through USB 2: the USB connection is the limiting factor for transfer speeds. If we were to connect this disk using USB 3, we could expect 100 MByte/s transfer speeds (the disk’s limit), though not the approximately 500 MByte/s that USB 3 is capable of pushing. If we are to transfer large files to and from this disk, these are the numbers that really matter. | + | **mkdir ~/Pictures/BackupedImages** |
- | On the other hand, we can also see access times in the 15 - 20 ms range. These values are rather standard for platter hard drives. They will affect backup speeds especially when transferring a large number of small files, since the disks must make a seek operation at the beginning of each transfer. | + | **that |
- | The second benchmark (next page, top left) was made with an SSD (Solid-State Disk) drive, also connected through the very same USB 2 link. In this case, we can see that transfer speeds remain essentially the same, even though the disk itself is capable of very high throughputs, | + | **cd ~/Dropbox** |
- | On the other hand, we can also see how access times are greatly reduced, to the sub-1ms range. This means that using an SSD, even behind a slow USB 2 connection, is still worthwhile when transferring a lot of very small files. Access to each file to initiate each individual transfer happens more quickly. This advantage can also be retained when using a faster connection such as USB 3. | + | **ln -s ~/ |
- | The general take-home idea is that, in each backup situation, we should take into account not only the hardware aspects, but also the kind (size and number) of files to be transferred in order to decide on the external disk units and connection technology to be used. In general, however, one can almost never go wrong in buying the fastest and largest disks one can afford at a given time. | + | Par exemple, nous pourrions créer un sous-répertoire nommé BackupedImages |
- | This being said, we can also decide on several different software approaches to perform the actual file transfer. | + | mkdir ~/ |
- | From a personal standpoint, I tend to avoid the use of compressed files (ZIP or gzipped TAR archives), preferring simply to clone the file and directory hierarchy on the backup. This way, it is easier to navigate through the backup and retrieve a single file or several files if needed, without having to uncompress a complete disk image. | + | et nous pourrions créer un lien symbolique dans le dossier Dropbox |
- | To make such a plain file system backup, several strategies can be used. The easiest is simply to copy over the complete directory tree, replicating both new files and those already existing in the backup. A more advanced option would be to copy over only new or modified files, reducing backup times by not transferring existing files. This second approach can be performed either by hand (slow and error prone), or using an automated system (quicker). | + | cd ~/ |
- | rsync is a utility that has been included in most GNU/Linux distributions for some time now. Originally designed to perform remote synchronization operations | + | ln-s ~/Photos/BackupedImages |
- | rsync -aruv /home/alan/* / | + | **Any files placed or modified in Pictures/BackupedImages will be automatically uploaded into the cloud if we are online, or as soon as we get connectivity.** |
- | and it will take care of the complete backup for us. Output shows us which files are being transferred at each step. | + | Ainsi, tous les fichiers placés ou modifiés dans Photos/ |
- | On the other hand, if we should need to recover backuped files - for example, when “populating” a new or freshly-formatted computer - we can reverse the process with: | + | **Naturally, |
+ | |||
+ | Bien évidement, cette arborescence devra être répliquée sur nos autres machines afin que les documents soient disponibles dans les mêmes conditions. Ainsi, il est préférable de mettre en pause la synchronisation de Dropbox avant de créer ces répertoires et ces liens ; vous la réactiverez plus tard. | ||
+ | |||
+ | **This also applies to similar services such as Canonical’s Ubuntu One. However, in this particular case, you will need to use One’s control panel to add the different folders you want to backup, as directly creating a link does not seem to work well.** | ||
+ | |||
+ | Ceci est valable également pour les services similaires tels qu' | ||
+ | |||
+ | **It may be tempting to include the Desktop itself within the backup scheme. However, some people use our Desktop as a temporary work zone. We tend to hammer our files quite hard, e.g. while compiling programs, so we would not want each and every file change to be reflected up into the cloud clogging up our Internet access in the process. In such cases, it is best to do our work in another directory, and then copy files into the backup zone when they have reached a certain level of stability, perhaps at the end of each work day.** | ||
+ | |||
+ | Il peut être également tentant de vouloir inclure le bureau en lui-même dans la stratégie de sauvegarde. Cependant, certaines personnes utilisent le « bureau » en tant que zone de travail temporaire et ont tendance à faire beaucoup de modifications sur ces fichiers, par exemple lors de la compilation de programmes, et ne souhaitent pas forcément encombrer leur accès Internet pour que toutes ces modifications soient stockées dans le nuage. Dans de tels cas, il est préférable d' | ||
+ | |||
+ | **Backing up to external drives** | ||
+ | |||
+ | Sauvegarde sur disques durs externes | ||
+ | |||
+ | **External drives are relatively cheap nowadays. Many USB-connected models can be found either in the 2½“ form factor, or in 3½” form. In the first case, the enclosure will contain a disk drive designed for laptops and that can usually run on 5V power supplied directly by the computer through the USB cable. In the second, it will contain a drive designed for desktop computers, that needs both 5V and 12V power, and so will require an additional power brick (transformer). If you need compactness and wish to minimize cabling, go for the first. If you need large capacities (above 1.5 TByte and up to 3 TByte), the second type will fulfill your needs better.** | ||
+ | |||
+ | Les disques externes sont relativement abordables de nos jours. De nombreux modèles avec connexion USB peuvent être trouvés, soit dans un format de 2,5 pouces soit dans un format de 3,5 pouces. | ||
+ | |||
+ | **Besides the disk itself, a second factor to take into account is the connection. USB version 2 connectors are rated at 480 Mb/s line speed, which in practice translates to 30 to 35 MBytes/s. USB version 3 can in theory go up to 5 Gb/s line speed, far outstripping current spinning platter disks’ read/write speeds. However, they do need both a USB 3 enclosure and a USB 3 port on the computer. Finally, other solutions also exist such as Firewire (IEEE 1394) enclosures, or the newer generation of consumer-grade NAS stations than can be accessed directly through the network. In order of speed, USB 3 and high-speed Firewire connections outstrip USB 2 and Gigabit Ethernet (to a NAS), with Fast Ethernet (also to a NAS) a slower alternative. Needless to say, a WiFi connection to a NAS is to be avoided whenever possible: it has the lowest bandwidth, and this is shared between all users connected at the same time.** | ||
+ | |||
+ | Outre le disque en lui-même, un deuxième facteur à prendre en compte est la connexion. Dans leur version 2, les connecteurs USB permettent d' | ||
+ | |||
+ | **Whichever connection type you use, performance depends on both factors, the disk and the connection. It is important for the actual use of backups. Nobody wants to wait half an hour for some videos to be copied over, when, with another setup, five minutes might suffice.** | ||
+ | |||
+ | Quel que soit le type de connexion que vous utilisez, la performance dépend de deux facteurs : le disque et la connexion. C'est important pour la réalisation de vos sauvegardes. Personne ne veut attendre une demi-heure pour la copie de quelques vidéos, alors qu' | ||
+ | |||
+ | **The Disks applet (gnome-disk) comes as standard on current Ubuntu distributions, | ||
+ | |||
+ | L' | ||
+ | |||
+ | **In the first (top left), we can see how a standard 500 GByte spinning platter hard drive - natively capable of reading and writing at about 100 MByte/s - is limited to 33 MByte/s reading and 20 MByte/s writing when connected through USB 2: the USB connection is the limiting factor for transfer speeds. If we were to connect this disk using USB 3, we could expect 100 MByte/s transfer speeds (the disk’s limit), though not the approximately 500 MByte/s that USB 3 is capable of pushing. If we are to transfer large files to and from this disk, these are the numbers that really matter.** | ||
+ | |||
+ | Dans la première capture (en haut à gauche), nous pouvons voir comment un disque dur standard de 500 Go - nativement capable de lire et écrire à environ 100 Mo/s - est limité à 33 Mo/s en lecture et 20 Mo/s en écriture lorsqu' | ||
+ | |||
+ | **On the other hand, we can also see access times in the 15 - 20 ms range. These values are rather standard for platter hard drives. They will affect backup speeds especially when transferring a large number of small files, since the disks must make a seek operation at the beginning of each transfer.** | ||
+ | |||
+ | D' | ||
+ | |||
+ | **The second benchmark (next page, top left) was made with an SSD (Solid-State Disk) drive, also connected through the very same USB 2 link. In this case, we can see that transfer speeds remain essentially the same, even though the disk itself is capable of very high throughputs, | ||
+ | |||
+ | Le deuxième indicateur de référence (page suivante, en haut à gauche) a été constaté avec un disque SSD (Solid-State Disk), également reliée par le même lien USB 2. Dans ce cas, nous pouvons voir que les vitesses de transfert demeurent essentiellement les mêmes, même si le disque lui-même est capable d' | ||
+ | |||
+ | **On the other hand, we can also see how access times are greatly reduced, to the sub-1ms range. This means that using an SSD, even behind a slow USB 2 connection, is still worthwhile when transferring a lot of very small files. Access to each file to initiate each individual transfer happens more quickly. This advantage can also be retained when using a faster connection such as USB 3.** | ||
+ | |||
+ | D' | ||
+ | |||
+ | **The general take-home idea is that, in each backup situation, we should take into account not only the hardware aspects, but also the kind (size and number) of files to be transferred in order to decide on the external disk units and connection technology to be used. In general, however, one can almost never go wrong in buying the fastest and largest disks one can afford at a given time.** | ||
+ | |||
+ | L' | ||
+ | |||
+ | **This being said, we can also decide on several different software approaches to perform the actual file transfer. ** | ||
+ | |||
+ | Ceci étant dit, nous pouvons aussi considérer plusieurs approches logiciel pour le véritable transfert de fichier. | ||
+ | |||
+ | **From a personal standpoint, I tend to avoid the use of compressed files (ZIP or gzipped TAR archives), preferring simply to clone the file and directory hierarchy on the backup. This way, it is easier to navigate through the backup and retrieve a single file or several files if needed, without having to uncompress a complete disk image.** | ||
+ | |||
+ | D'un point de vue personnel, j'ai tendance à éviter l' | ||
+ | |||
+ | **To make such a plain file system backup, several strategies can be used. The easiest is simply to copy over the complete directory tree, replicating both new files and those already existing in the backup. A more advanced option would be to copy over only new or modified files, reducing backup times by not transferring existing files. This second approach can be performed either by hand (slow and error prone), or using an automated system (quicker).** | ||
+ | |||
+ | Pour faire une telle sauvegarde du système de fichiers simple, plusieurs stratégies peuvent être utilisées. Le plus simple consiste à copier l' | ||
+ | |||
+ | **rsync is a utility that has been included in most GNU/Linux distributions for some time now. Originally designed to perform remote synchronization operations - as its name indicates - it is also very effective to do local backups to an external drive. Supposing that we wish to backup the complete contents of our user’s home directory /home/alan to an external drive that is mounted on / | ||
+ | |||
+ | rsync est un utilitaire qui a été inclus dans la plupart des distributions GNU/Linux depuis un certain temps. Initialement conçu pour effectuer des opérations de synchronisation à distance - comme son nom l' | ||
+ | |||
+ | **rsync -aruv / | ||
+ | |||
+ | **and it will take care of the complete backup for us. Output shows us which files are being transferred at each step.** | ||
+ | |||
+ | et rsync effectuera cette sauvegarde complète pour nous. La sortie sur écran nous montre les fichiers qui sont transférés à chaque étape. | ||
+ | |||
+ | **On the other hand, if we should need to recover backuped files - for example, when “populating” a new or freshly-formatted computer - we can reverse the process with:** | ||
+ | |||
+ | D' | ||
rsync -aruv / | rsync -aruv / | ||
- | As you can see, it is in fact indifferent whether our /home directory is mounted as a separate partition or not, though it is certainly of good practice to do so. | + | **As you can see, it is in fact indifferent whether our /home directory is mounted as a separate partition or not, though it is certainly of good practice to do so.** |
- | Syncing files between two computers | + | Comme vous pouvez le voir, notre répertoire /home n'a pas besoin d' |
- | In this day and age, many of us are the happy owners of not one, but two or more computers. When older machines are replaced by newer ones, they are not always sold off. The economics of the consumer market are set up so that selling a computer with, say, three to five years of continuous use on it will not net us much cash. | + | **Syncing files between |
- | But such older machines, while not quite as fast, may in many cases still function quite well as secondary or backup machines. Actual flavours of Ubuntu (or perhaps Lubuntu or Xubuntu) work quite well on a 2008 dual-core or suchlike. If the computer itself has no major hardware issues, the only part that may need replacing in order to convert it into a backup unit would be a larger hard disk drive, though this may not even be the case depending on your storage needs. Actually, this could be a good way to get even more service out of a laptop with a broken screen or a dead battery. | + | Synchronisation de fichiers entre deux ordinateurs |
- | A strategy that has worked quite well for me is to actually clone my various computers, and keep a complete copy of all of my files on each computer at all times. This way, I can choose one or the other for any given task, taking into account only the needs of that particular task (do I need the fast CPU? Or the large screen? Or the little, light ‘un to carry around all day?) and not the availability of data files. My data is always available to me. | + | **In this day and age, many of us are the happy owners |
- | Having accumulated several hundreds of GigaBytes over the years, copying over all the files over WiFi can get to be a bother. This is when a modest investment (less than $10) in an Ethernet crossover cable can help speed up the process considerably. This is basically a piece of cable that internally connects one computer’s Ethernet TX (Transmission) port to the opposite side’s RX (Reception), and vice-versa. It can be used to do away with a network switch, and since there are only two computers | + | De nos jours, beaucoup d' |
- | These days, crossover cables are usually found in red color, though it is best to check it is not actually | + | **But such older machines, while not quite as fast, may in many cases still function quite well as secondary or backup machines. Actual flavours of Ubuntu (or perhaps Lubuntu or Xubuntu) work quite well on a 2008 dual-core or suchlike. If the computer itself has no major hardware issues, the only part that may need replacing in order to convert |
- | Before connecting the computers, we will need to draw up a strategy for file transfers. Which protocol do we use, and which programs? Since we have already seen the rsync utility in this article, I will continue using it, but this time over a SSH link instead of to a locally-connected external disk. | + | Mais ces machines plus anciennes, certes moins rapides, peuvent dans de nombreux cas encore très bien être utilisées comme des machines secondaires ou de sauvegarde. Les distributions Ubuntu (ou peut-être Lubuntu ou Xubuntu) fonctionnent très bien sur un dual-core de 2008 ou équivalent. Si l' |
- | Setting up an SSH link on Ubuntu systems simply implies installing the openssh-server package on one computer (the client package | + | **A strategy that has worked quite well for me is to actually clone my various computers, and keep a complete copy of all of my files on each computer at all times. This way, I can choose one or the other for any given task, taking into account only the needs of that particular task (do I need the fast CPU? Or the large screen? Or the little, light ‘un to carry around all day?) and not the availability of data files. My data is always available to me.** |
+ | Une stratégie qui a bien fonctionné chez moi, consistait à cloner mes différents ordinateurs et à conserver une copie intégrale de tous mes fichiers sur chaque ordinateur à tout moment. De cette façon, je peux choisir l'un ou l' | ||
+ | |||
+ | **Having accumulated several hundreds of GigaBytes over the years, copying over all the files over WiFi can get to be a bother. This is when a modest investment (less than $10) in an Ethernet crossover cable can help speed up the process considerably. This is basically a piece of cable that internally connects one computer’s Ethernet TX (Transmission) port to the opposite side’s RX (Reception), | ||
+ | |||
+ | Après avoir accumulé plusieurs centaines de giga-octets au fil des années, la copie de tous les fichiers au travers d'un réseau WiFi est un handicap. C'est alors qu'un investissement modeste (moins de 10 $) dans un câble Ethernet croisé peut aider à accélérer considérablement le processus de copie. Il s'agit d'un câble Ethernet qui relie le port Ethernet TX (Transmission) d'un ordinateur au port RX (réception) d'un autre ordinateur, et vice-versa. Il peut être utilisé pour s' | ||
+ | |||
+ | **These days, crossover cables are usually found in red color, though it is best to check it is not actually a straight patch cable (slightly cheaper).** | ||
+ | |||
+ | Des nos jours, les câbles croisés sont généralement de couleur rouge, mais il est préférable de vérifier qu'il ne s'agit pas d'un câble de raccordement droit (un peu moins cher). | ||
+ | |||
+ | **Before connecting the computers, we will need to draw up a strategy for file transfers. Which protocol do we use, and which programs? Since we have already seen the rsync utility in this article, I will continue using it, but this time over a SSH link instead of to a locally-connected external disk. ** | ||
+ | |||
+ | Avant de connecter les ordinateurs entre eux, nous aurons besoin d' | ||
+ | |||
+ | **Setting up an SSH link on Ubuntu systems simply implies installing the openssh-server package on one computer (the client package is already installed by default on both). This can be done from the terminal:** | ||
+ | |||
+ | Mettre en place une liaison SSH sur les systèmes Ubuntu signifie simplement installer le paquet openssh-server sur un ordinateur (le module client est déjà installé par défaut). Cela peut être fait à partir du terminal : | ||
$ sudo bash | $ sudo bash | ||
- | # aptitude update | + | **# aptitude update** |
+ | |||
+ | Mise à jour # aptitude | ||
# aptitude install openssh-server | # aptitude install openssh-server | ||
- | or it can also be done from within any graphical software management program you prefer: Synaptic, the Ubuntu Software center, Muon, etc. | + | **or it can also be done from within any graphical software management program you prefer: Synaptic, the Ubuntu Software center, Muon, etc. ** |
- | Once installed, the SSH server automatically creates its key pair, and starts up. You can check it is working from the terminal on the same machine it is installed on by issuing: | + | on peut aussi le faire à partir de n' |
+ | |||
+ | **Once installed, the SSH server automatically creates its key pair, and starts up. You can check it is working from the terminal on the same machine it is installed on by issuing:** | ||
+ | |||
+ | Une fois installé, le serveur SSH crée automatiquement sa paire de clés et démarre. Vous pouvez vérifier qu'il fonctionne à partir du terminal sur la même machine où il est installé en utilisant la commande | ||
ssh localhost | ssh localhost | ||
- | If the terminal requests confirmation to continue connecting, and then asks you for your password, you are in business. | + | **If the terminal requests confirmation to continue connecting, and then asks you for your password, you are in business.** |
+ | |||
+ | Si cette commande vous permet de continuer la connexion et vous demande votre mot de passe, alors cela indique que tout est bien installé. | ||
+ | |||
+ | **If you prefer to use SSH using a certificate, | ||
+ | |||
+ | Si vous préférez utiliser SSH en utilisant un certificat, sans avoir à entrer un mot de passe à chaque fois que vous vous connectez, vous pouvez suivre les instructions de ce fil d' | ||
+ | |||
+ | **Once both computers are connected, we will need to configure IP addresses. Since running a DHCP server on one of our machines is probably a bit high on the geek-meter for ordinary users, that leaves two choices open to us:** | ||
+ | |||
+ | Une fois les deux ordinateurs connectés ensemble, nous aurons besoin de configurer les adresses IP. Si l' | ||
- | If you prefer to use SSH using a certificate, | + | **manually set an IPv4 address on each computer** |
+ | - définir manuellement une adresse IPv4 sur chaque ordinateur | ||
+ | **use IPv6 and its autoconfiguration feature** | ||
+ | - utiliser IPv6 et sa fonction d'auto-configuration | ||
- | Once both computers are connected, we will need to configure IP addresses. Since running a DHCP server on one of our machines is probably a bit high on the geek-meter for ordinary users, that leaves two choices open to us: | + | **If using IPv4, I suggest you use the 172.16.0.0/ |
- | • manually set an IPv4 address on each computer | + | |
- | • use IPv6 and its autoconfiguration feature | + | |
- | If using IPv4, I suggest you use the 172.16.0.0/ | + | Si vous utilisez |
sudo bash | sudo bash | ||
Ligne 124: | Ligne 234: | ||
# ifconfig eth0 172.16.0.1/ | # ifconfig eth0 172.16.0.1/ | ||
- | and on the other machine | + | **and on the other machine** |
+ | et sur l' | ||
sudo bash | sudo bash | ||
Ligne 130: | Ligne 241: | ||
# ifconfig eth0 172.16.0.2/ | # ifconfig eth0 172.16.0.2/ | ||
- | If this works out well, you can now ping back and forward between the machines. On the server, to ping three times the other computer, issue: | + | **If this works out well, you can now ping back and forward between the machines. On the server, to ping three times the other computer, issue:** |
+ | |||
+ | Si cela fonctionne bien, vous pouvez maintenant faire un « ping » aller et retour entre les machines. Sur le serveur, pour lancer la commande « ping » trois fois vers l' | ||
ping 172.16.0.2 -c 3 | ping 172.16.0.2 -c 3 | ||
- | You should see several lines starting with “received 64 bytes” and with a time in milliseconds at the end. If you get lines containing “Destination Host Unreachable”, | + | **You should see several lines starting with “received 64 bytes” and with a time in milliseconds at the end. If you get lines containing “Destination Host Unreachable”, |
- | On the other hand, IPv6 automatic address configuration has a distinct advantage over IPv4: the same link-local address will always be assigned to the same interface on each machine every time, and without needing any manual configuration. To know which address you have assigned to the eth0 interface, issue | + | Vous devriez voir plusieurs lignes commençant par "64 bytes from" et avec un temps en millisecondes à la fin. Si vous obtenez des lignes contenant " |
+ | |||
+ | **On the other hand, IPv6 automatic address configuration has a distinct advantage over IPv4: the same link-local address will always be assigned to the same interface on each machine every time, and without needing any manual configuration. To know which address you have assigned to the eth0 interface, issue** | ||
+ | |||
+ | D' | ||
ifconfig eth0 | ifconfig eth0 | ||
- | You should obtain something like that shown below. | + | **You should obtain something like that shown below.** |
+ | |||
+ | Vous devriez obtenir quelque chose comme indiqué au bas de cette page. | ||
+ | |||
+ | **Note the IPv6 address on the second line down, beginning with “fe80:: | ||
+ | |||
+ | Notez l' | ||
- | Note the IPv6 address on the second line down, beginning with “fe80::”. | + | **From the other computer, I can now ping this one using the IPv6 ping6 utility:** |
- | From the other computer, I can now ping this one using the IPv6 ping6 utility: | + | Depuis l' |
ping6 fe80:: | ping6 fe80:: | ||
- | Please note I left out the /64 netmask, and tacked on the %eth0 interface indicator at the end. | + | **Please note I left out the /64 netmask, and tacked on the %eth0 interface indicator at the end.** |
- | Now, on to doing the actual backup. From the other computer, I can update all my files on the SSH server using either | + | Notez que j'ai volontairement omis le masque en /64 et ajouté l' |
+ | |||
+ | **Now, on to doing the actual backup. From the other computer, I can update all my files on the SSH server using either** | ||
+ | |||
+ | Maintenant, faisons la sauvegarde réelle : de l' | ||
rsync -aruv / | rsync -aruv / | ||
- | or | + | **or** |
+ | |||
+ | soit : | ||
rsync -aruv / | rsync -aruv / | ||
- | IPv6 addresses often need to be placed between ‘[]’ keys. In either case, the server should require my password, and then start performing synchronization. | + | **IPv6 addresses often need to be placed between ‘[]’ keys. In either case, the server should require my password, and then start performing synchronization.** |
- | In the other sense, I can synchronize all files from the server to the other computer using similar rsync commands: | + | Les adresses IPv6 doivent souvent être placées entre les caractères « [] ». Dans les deux cas, le serveur devrait exiger mon mot de passe, puis commencer à effectuer la synchronisation. |
+ | |||
+ | **In the other sense, I can synchronize all files from the server to the other computer using similar rsync commands:** | ||
+ | |||
+ | Dans l' | ||
rsync -aruv 172.16.0.1:/ | rsync -aruv 172.16.0.1:/ | ||
- | or | + | **or** |
+ | |||
+ | ou | ||
rsync -aruv [fe80:: | rsync -aruv [fe80:: | ||
- | To make sure all files are up-to-date on both machines, it may be necessary to perform synchronization in both directions - especially if both computers are occasionally used to work on and modify files. Naturally, this sequence can be automated within a script file, that could, for example, be called backup.sh: | + | **To make sure all files are up-to-date on both machines, it may be necessary to perform synchronization in both directions - especially if both computers are occasionally used to work on and modify files. Naturally, this sequence can be automated within a script file, that could, for example, be called |
+ | |||
+ | Pour vous assurer que tous les fichiers sont à jour sur les deux machines, il peut être nécessaire d' | ||
#!/bin/bash | #!/bin/bash | ||
Ligne 176: | Ligne 313: | ||
rsync -aruv [fe80:: | rsync -aruv [fe80:: | ||
- | The file will need to be made executable with | + | **The file will need to be made executable with** |
+ | |||
+ | Ce fichier devra posséder les droit d' | ||
chmod 755 backup.sh | chmod 755 backup.sh | ||
- | before use. It can then executed with | + | **before use. It can then executed with** |
+ | |||
+ | Il peut alors ensuite être exécuté avec : | ||
./backup.sh | ./backup.sh | ||
- | Graphical frontends for automatic backups | + | **Graphical frontends for automatic backups** |
+ | |||
+ | Interfaces graphiques pour les sauvegardes automatiques | ||
+ | |||
+ | **By this point, some readers may be asking themselves if I ever intend to talk about automatic backup apps, such as the Déjà Dup program that now comes installed as standard in Ubuntu.** | ||
+ | |||
+ | À ce stade, certains lecteurs se demandent peut-être si j'ai l' | ||
+ | |||
+ | **There are two different points of view regarding this kind of program. Automatic backups can help take a little of the hassle out of making backups: they do the remembering for you, and handle most if not all of the action.** | ||
+ | |||
+ | Il y a deux points de vue différents en ce qui concerne ce genre de programme. Les sauvegardes automatiques peuvent aider à surmonter les tracas d'une sauvegarde : elles vont vous rappeler qu'il est temps de faire une sauvegarde, voire faire une partie ou la totalité des opérations. | ||
+ | |||
+ | **But it can also be argued that this can in fact become a bit of a liability, since depending on automatic actions will, over time, tend to make us less aware of what the computer is actually doing. We will end up not staying on top of our backup volume’s level of free space, for example. We may take for granted that such or such files are being regularly backup up, without noticing that in actual fact they are not. Graphical interfaces to the backup process add an element of abstraction that may make things easier to configure for the novice, but unfortunately also obscure the inner workings of the process - which in turn makes mistakes and subsequent disaster situations all the more probable.** | ||
+ | |||
+ | Mais cela a aussi une fâcheuse tendance à nous rendre moins responsables, | ||
+ | |||
+ | **Doing manual backups, on the other hand, obligates us to remain aware of what we are doing. We can also keep visual track of the files as they go over - if anything that is important for us and really should be copied, but it’s not copied, we see it on the spot. If something weird comes up in the messages, likewise.** | ||
- | By this point, some readers may be asking themselves if I ever intend to talk about automatic backup apps, such as the Déjà Dup program that now comes installed as standard in Ubuntu. | + | Faire des sauvegardes manuellement nous oblige à comprendre ce que nous faisons. Nous pouvons également apprécier la bonne sauvegarde de nos fichiers et constater la bonne copie ou non de tel ou tel fichier. De même, nous pouvons acquitter les différents messages d' |
- | There are two different points of view regarding this kind of program. Automatic backups can help take a little | + | **So, while making the backup process as automatic as possible may seem a good idea from the standpoint |
- | But it can also be argued that this can in fact become a bit of a liability, since depending on automatic actions will, over time, tend to make us less aware of what the computer is actually doing. We will end up not staying on top of our backup volume’s level of free space, for example. We may take for granted that such or such files are being regularly backup up, without noticing that in actual fact they are not. Graphical interfaces to the backup process add an element of abstraction that may make things easier to configure for the novice, but unfortunately also obscure the inner workings of the process - which in turn makes mistakes and subsequent disaster situations all the more probable. | + | Ainsi, faire en sorte que le processus de sauvegarde soit aussi automatisé que possible peut sembler être une bonne idée du point de vue de la réduction des ennuis (souvenez-vous : les sauvegardes doivent être faciles à faire, si nous voulons qu' |
- | Doing manual backups, on the other hand, obligates us to remain aware of what we are doing. We can also keep visual track of the files as they go over - if anything that is important for us and really should be copied, but it’s not copied, we see it on the spot. If something weird comes up in the messages, likewise. | + | **In any case, if in any doubt whether to backup or not, please do so - and in as many copies as possible.** |
- | So, while making the backup process as automatic as possible may seem a good idea from the standpoint of hassle reduction (remember backups must be easy to do, if we want them to actually get done in the real world), perhaps a more balanced approach would be to combine automatic features such as scripts or even graphical applications with a certain level of human control and overview. | + | Dans tous les cas, en cas de doute sur le bien-fondé d'une sauvegarde, n' |
- | In any case, if in any doubt whether to backup or not, please do so - and in as many copies as possible. |
issue83/sauvegardes.1399824735.txt.gz · Dernière modification : 2014/05/11 18:12 de andre_domenech