Skip to content

Menu

  • Home
  • Sysadmin
  • Debian
  • Security
  • Docker

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

SpaaaceNo Ads, No Trackers, No AI, just DevOps

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

  • APT Upgrade Handling using Ansible
  • Sentry alternative: Bugsink to the rescue
  • Create SWAP on ZFS ZVOL
  • Raspberry Pi Grafana Kiosk
  • Proxmox Grafana Dashboard

Categories

  • Ansible
  • Debian
  • Development
  • Docker
  • IaC
  • Monitoring
  • Personal
  • Proxmox
  • Raspberry Pi
  • Security
  • Sysadmin