SSH Tar GZip Zip Backup and Restore

By North Street, A Creative Studio

SSH into server, then use this command to compress:

tar -zcvf folder_name.tar.gz folder_name/

To decompress into the current directory, use the following:

tar -vxzf folder_name.tar.gz

NOTE: If you get an error using the above, then try:

unzip folder_name.tar.gz

EDIT: When create a tar file on mac, it adds all the extended attribute files, that start with “._”…. These will show up on the webserver when you extract using the above command. If this annoys you as much as it does me, then do the following to remove them.

cd DIRECTORY_OF_WEBSITE
find -name "._*" -exec rm -rf {} \;

Want to know how to upload or download a zip file through ssh? use SCP:
/using-scp-to-upload-or-download-a-file-through-ssh/

 

About north street

We engineer the thoughtful transformation of great organizations. Our proven process helps us understand what your competitors are doing right — and wrong. Want to learn more? Let’s chat.

More Notes

Collage of colorful shapes, mobile phones, and text.

Welcome to Your 2024 Branding Pep Talk

A bowler hat floating on top of radio waves in the background

CEO Tom Conlon Talks Shop on Podcast Marketing Secrets

Tom Conlon

CEO Tom Conlon in Conversation with The Opinionistics