Dokumentation für Linux-Admins [stefanux.de]
Dokumentation für Linux-Admins [stefanux.de]
  • Anmelden

  1. Zuletzt angesehen
  2. verzeichnisse
  3. gliederung
  4. geschäftsbriefe
  5. diagramme
  6. verwaltung-und-tools
  7. verzeichnisdienste
  8. unterverzeichnisse_einzeln_packen

shellscripts:unterverzeichnisse_einzeln_packen

Linux

Linux

Linux
Dateisystemaufbau
Partitionierung
Dateisysteme und Formatierung
RAID
ZFS
Netzwerke
SSH
Shellscripts
Festplattenverschlüsselung

Infrastruktur

ansible
...meine ansible collection
lessons-learned
cloud-computing
postfix dovecot
proxmox
libvirt mit KVM
powerdns
cloud-init
ceph storage cluster
wireguard
zabbix

Tools

git
mattermost
letsencrypt

Kontakt

eMail-Adresse
Hilfe vom Autor
github profile
Xing profile
Linked.in profile
Impressum

  • Teilen per
    • Teilen per...
    • Twitter
    • LinkedIn
    • Facebook
    • Pinterest
    • Telegram
    • WhatsApp
    • Reddit
  • Letzte Änderungen
  • Per E-Mail senden
  • Drucken
  • Permalink

Unterverzeichnisse einzeln packen

Aufgabe: /pfad – /ordner1 – /ordner2 – usw.

Ergebnis:


/backuppfad/ordner1.tar.gz /backuppfad/ordner2.tar.gz usw.

#!/bin/sh
 
PATH_DEST=/path/to/data
PATH_BACKUP=/path/to/backup
 
cd $PATH_DEST
for d in `find . -maxdepth 1 -mindepth 1 -type d`; do i=`basename ${d}`; tar -cjf $PATH_BACKUP/$i.tar.bz2 "$i"; done

cc by nc sa

Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht:
CC Attribution-Noncommercial-Share Alike 4.0 International