Skip to content

Menu

  • Home
  • Sysadmin
  • Debian
  • Security
  • Docker

Blog by Constantin Herold | Theme by ThemeinProgress | Proudly powered by WordPress

Spaaacesysadmin & dev stuff

Copy Files via Shell

February 23, 2021Debian, Sysadmin Standard
Read time < 1 minute

Maybe you are limited and have no SFTP client available or just want a simple fast way to copy some config files from a server.

All the tools you need are already installed.

To backup the current directory

find . | tar cPf - --files-from - | gzip -9 | base64

It returns your files compressed and encoded as base64 with owner mappings and file permissions.

You can adjust find to copy specific files even recursively.

To restore them

cat << 'EOF' | base64 -d | zcat | tar xvPf -
BASE64
EOF

Write a Reply or Comment Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Create SWAP on ZFS ZVOL
  • Raspberry Pi Grafana Kiosk
  • Proxmox Grafana Dashboard
  • Proxmox Full Disk Encryption with SSH Remote Unlock
  • Login Mail Alert Using Rsyslog

Categories

  • Debian
  • Docker
  • Monitoring
  • Personal
  • Proxmox
  • Raspberry Pi
  • Security
  • Sysadmin