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/09/14 22:35] – lecastillan | issue83:sauvegardes [2014/09/16 17:52] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 9: | Ligne 9: | ||
**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.** | **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.** | ||
- | Dans l' | + | Dans l' |
**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 is, in practice, next to useless if it is not user-friendly, | **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 is, in practice, next to useless if it is not user-friendly, | ||
- | Mais, toutes les stratégies de sauvegarde ne se valent pas. En premier lieu, réaliser une sauvegarde doit être quelque chose de facile | + | Mais toutes les stratégies de sauvegarde ne se valent pas. En premier lieu, réaliser une sauvegarde doit être quelque chose de facile, |
**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 (I’m supposing a 384 kbit/s uplink here). So no, we will not be uploading the entire contents of our video library to Ubuntu One, and certainly not over a measly ADSL connection.** | **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 (I’m supposing a 384 kbit/s uplink here). So no, we will not be uploading the entire contents of our video library to Ubuntu One, and certainly not over a measly ADSL connection.** | ||
- | D' | + | D' |
**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.** | **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.** | ||
- | 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 simplement | + | 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 |
**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.** | **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.** | ||
- | Heureusement, | + | Heureusement, |
**Cloud-based storage** | **Cloud-based storage** | ||
Ligne 33: | Ligne 33: | ||
**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 such as Dropbox, StrongOak, Ubuntu One and many others), or even edit them directly online (Google Drive). They magically appear and are updated on all your other computers, often with download access from tablets and mobile phones as well. Easily sharing documents with other users may be an added perk. Providers have their own professional backup plans for their servers, so once on there your backed-up documents are probably safer than anywhere else – it would take a major technological disaster to render them inaccessible.** | **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 such as Dropbox, StrongOak, Ubuntu One and many others), or even edit them directly online (Google Drive). They magically appear and are updated on all your other computers, often with download access from tablets and mobile phones as well. Easily sharing documents with other users may be an added perk. Providers have their own professional backup plans for their servers, so once on there your backed-up documents are probably safer than anywhere else – it would take a major technological disaster to render them inaccessible.** | ||
- | Le stockage en nuage est actuellement à la mode concernant notre bureautique à la maison (et, jusqu' | + | Le stockage en nuage est actuellement à la mode concernant notre bureautique à la maison (et, jusqu' |
**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, | **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, | ||
- | Cependant, en utilisant ce type de service, nous devrions aussi être conscients de plusieurs mises en garde. Comme mentionné ci-dessus, l' | + | Cependant, en utilisant ce type de service, nous devrions aussi être conscients de plusieurs mises en garde. Comme mentionné ci-dessus, l' |
**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.** | **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.** | ||
- | Selon le type d' | + | Selon le type d' |
**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. ** | **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. ** | ||
Ligne 50: | Ligne 50: | ||
**Whatever strategy we apply will probably use the existing Ubuntu directory structure at some point. Most applications are already tuned to the default ~/ | **Whatever strategy we apply will probably use the existing Ubuntu directory structure at some point. Most applications are already tuned to the default ~/ | ||
- | Quelle que soit la stratégie que nous appliquons nous allons probablement utiliser la structure de répertoires d' | + | Quelle que soit la stratégie que nous appliquons nous allons probablement utiliser la structure de répertoires d' |
**For example, we could create a BackupedImages subdirectory within Pictures** | **For example, we could create a BackupedImages subdirectory within Pictures** | ||
Ligne 62: | Ligne 62: | ||
**ln -s ~/ | **ln -s ~/ | ||
- | Par exemple, nous pourrions créer un sous-répertoire nommé BackupedImages (images sauvegardées en français) dans le répertoire Photos | + | Par exemple, nous pourrions créer un sous-répertoire nommé BackupedImages (images sauvegardées en français) dans le répertoire Photos |
- | mkdir ~ / Photos / BackupedImages | + | mkdir ~/ |
et nous pourrions créer un lien symbolique dans le dossier Dropbox | et nous pourrions créer un lien symbolique dans le dossier Dropbox | ||
- | cd ~ / Dropbox | + | cd ~/ |
- | ln-s ~ / Photos / BackupedImages | + | ln-s ~/ |
**Any files placed or modified in Pictures/ | **Any files placed or modified in Pictures/ | ||
- | Ainsi, tous les fichiers placés ou modifiés dans Photos / BackupedImages seront automatiquement transférés dans le nuage si nous sommes en ligne ou, dès que nous aurons une connexion Internet active. | + | Ainsi, tous les fichiers placés ou modifiés dans Photos/ |
**Naturally, | **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. | + | 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.** | **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 que Ubuntu One de Canonical | + | Ceci est valable également pour les services similaires tels qu'Ubuntu One de Canonical |
**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.** | **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 nous ne souhaitons | + | 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 |
**Backing up to external drives** | **Backing up to external drives** | ||
Ligne 94: | Ligne 94: | ||
**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.** | **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. | + | 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.** | **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 permettre | + | 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 |
**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.** | **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 demie-heure pour quelques vidéos | + | Quel que soit le type de connexion que vous utilisez, la performance dépend de deux facteurs |
**The Disks applet (gnome-disk) comes as standard on current Ubuntu distributions, | **The Disks applet (gnome-disk) comes as standard on current Ubuntu distributions, | ||
- | L' | + | 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.** | **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' | + | 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.** | **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' | + | 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, | **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' | + | 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.** | **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.** | ||
Ligne 126: | Ligne 126: | ||
**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.** | **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' | + | L' |
**This being said, we can also decide on several different software approaches to perform the actual file transfer. ** | **This being said, we can also decide on several different software approaches to perform the actual file transfer. ** | ||
- | Ceci étant dit, nous pouvons aussi partir sur plusieurs approches | + | Ceci étant dit, nous pouvons aussi considérer |
**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.** | **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' | + | 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).** | **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' | + | 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 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 maintenant. Initialement conçu pour effectuer des opérations de synchronisation à distance - comme son nom l' | + | 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 / | **rsync -aruv / | ||
Ligne 152: | Ligne 152: | ||
**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:** | **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' | + | D' |
rsync -aruv / | rsync -aruv / | ||
Ligne 158: | Ligne 158: | ||
**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.** | ||
- | Comme vous pouvez le voir, notre répertoire / home n'a pas besoin d' | + | Comme vous pouvez le voir, notre répertoire /home n'a pas besoin d' |
**Syncing files between two computers ** | **Syncing files between two computers ** | ||
Ligne 166: | Ligne 166: | ||
**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.** | **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.** | ||
- | De nos jours, beaucoup d' | + | De nos jours, beaucoup d' |
**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.** | **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.** | ||
- | 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 distribution 'Ubuntu (ou peut-être Lubuntu ou Xubuntu) fonctionnent très bien sur un dual-core de 2008 ou équivalent. Si l' | + | 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 |
**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.** | **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ée, | + | Une stratégie qui a bien fonctionné |
**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), | **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' | + | 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).** | **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 | + | Des nos jours, les câbles croisés |
**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. ** | **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:** | **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. ** | ||
+ | |||
+ | 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:** | **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, | **If you prefer to use SSH using a certificate, | ||
- | **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:* | + | 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' |
- | **• manually set an IPv4 address on each computer** | + | |
- | **• use IPv6 and its autoconfiguration feature** | + | **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' | ||
+ | |||
+ | **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' | ||
**If using IPv4, I suggest you use the 172.16.0.0/ | **If using IPv4, I suggest you use the 172.16.0.0/ | ||
+ | |||
+ | Si vous utilisez IPv4, je vous suggère d' | ||
sudo bash | sudo bash | ||
Ligne 215: | Ligne 235: | ||
**and on the other machine** | **and on the other machine** | ||
+ | et sur l' | ||
sudo bash | sudo bash | ||
Ligne 221: | Ligne 242: | ||
**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”, | ||
+ | |||
+ | 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** | **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:: | **Note the IPv6 address on the second line down, beginning with “fe80:: | ||
+ | |||
+ | Notez l' | ||
**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.** | ||
+ | |||
+ | 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** | **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.** | ||
+ | |||
+ | 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:** | **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 backup.sh: | ||
+ | |||
+ | Pour vous assurer que tous les fichiers sont à jour sur les deux machines, il peut être nécessaire d' | ||
#!/bin/bash | #!/bin/bash | ||
Ligne 267: | Ligne 314: | ||
**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.** | **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.** | **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.** | **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.** | **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.** | ||
+ | |||
+ | 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' | ||
**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.** | **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.** | ||
+ | |||
+ | 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' | ||
**In any case, if in any doubt whether to backup or not, please do so - and in as many copies as possible.** | **In any case, if in any doubt whether to backup or not, please do so - and in as many copies as possible.** | ||
+ | |||
+ | Dans tous les cas, en cas de doute sur le bien-fondé d'une sauvegarde, n' | ||
+ |
issue83/sauvegardes.1410726911.txt.gz · Dernière modification : 2014/09/14 22:35 de lecastillan