tech:tar_avec_cpio
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:tar_avec_cpio [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:tar_avec_cpio [2025/04/02 11:14] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| {{tag> | {{tag> | ||
| = Créer une archive tar depuis un find grâce à cpio | = Créer une archive tar depuis un find grâce à cpio | ||
| - | === Présentation | + | ### Présentation |
| **cpio** est à la fois le nom d'une __commande__ et d'un __format__ d' | **cpio** est à la fois le nom d'une __commande__ et d'un __format__ d' | ||
| - | Voir manuel | + | Voir manuel http:// |
| La commande **cpio** prend aussi en charge d' | La commande **cpio** prend aussi en charge d' | ||
| - | === Tar avec cpio | + | ### Tar avec cpio |
| Utilisez l' | Utilisez l' | ||
| - | < | + | ~~~bash |
| find . -depth | cpio -ov --format=ustar |pigz > archive.tar.gz | find . -depth | cpio -ov --format=ustar |pigz > archive.tar.gz | ||
| Ligne 21: | Ligne 22: | ||
| find . -depth | xargs tar czf archive.tar.gz | find . -depth | xargs tar czf archive.tar.gz | ||
| find . -exec tar rvf archive.tar " | find . -exec tar rvf archive.tar " | ||
| - | </ | + | ~~~ |
| //' | //' | ||
| - | < | + | ~~~bash |
| find . -type f |cpio -ov --format=ustar |pigz > archive.tar.gz | find . -type f |cpio -ov --format=ustar |pigz > archive.tar.gz | ||
| - | </ | + | ~~~ |
| Si vous avez des noms de fichiers avec des espaces et des caractères bizarres | Si vous avez des noms de fichiers avec des espaces et des caractères bizarres | ||
| - | < | + | ~~~bash |
| find . -depth -print0 |cpio -0 -ov --format=ustar |pigz > archive.tar.gz | find . -depth -print0 |cpio -0 -ov --format=ustar |pigz > archive.tar.gz | ||
| - | </ | + | ~~~ |
| Il est également possible de créer un tarball depuis un find (ou un **ls**) avec **Pax** qui est à privilégier. | Il est également possible de créer un tarball depuis un find (ou un **ls**) avec **Pax** qui est à privilégier. | ||
| Cependant contrairement à pax, cpio est livré par défaut dans la plupart des distributions. | Cependant contrairement à pax, cpio est livré par défaut dans la plupart des distributions. | ||
| - | Voir [[https:// | + | Voir [Pax](https:// |
| - | === Limitation | + | ### Limitation |
| - | Le format d' | + | Le format d' |
| * Taille max de l' | * Taille max de l' | ||
| Ligne 47: | Ligne 48: | ||
| * Taille max nom lien symbolique : 100 caractères | * Taille max nom lien symbolique : 100 caractères | ||
| - | Voir détails | + | Voir détails http:// |
| - | === Exemple en pratique | + | ### Exemple en pratique |
| [[debian_conflit_2paquet_meme_fichier]] | [[debian_conflit_2paquet_meme_fichier]] | ||
| - | == Autre CPIO | + | ## Autre CPIO |
| - | < | + | ~~~bash |
| find . -mount -print | cpio -pdm / | find . -mount -print | cpio -pdm / | ||
| - | </ | + | ~~~ |
| - | == Autre | + | ## Autre |
| Avec Tar | Avec Tar | ||
| - | < | + | ~~~bash |
| tar -cvf allfiles.tar -T mylist.txt | tar -cvf allfiles.tar -T mylist.txt | ||
| - | </ | + | ~~~ |
tech/tar_avec_cpio.1742825205.txt.gz · Dernière modification : de 127.0.0.1
