Backup site files in seconds

To backup all your site files in a flash use the following command line snippet

## No dash "-" with this order destination origin and on gnu os like DH Ubuntu
## http://unix.stackexchange.com/questions/13573/why-use-superflous-dash-to-pass-option-flags-to-tar
## Destination - origin unlike scp
tar cvzf sitecom.tar.gz directory-name
## And to empty directory 
rm -r /path/to/directory/*
## And to exclude a directory while backing up use
## Make sure not to add a trailing slash!
tar cvzf site.com.tar.gz site.com/ --exclude=site.com/wp-content/uploads/backupbuddy_backups

 

It will use tar and gzip to compress all the sites’ files into one package allowing you to store it anywhere and dowload it with ease as it is just one file and a lot smaller. Downloading your site as a backup using FTP or SFTP is way slower as you need to download all files one by one. Also, FTP takes time entering directories to grab the files there.

This option can only be used when you have command line or SSH access though. Otherwise you will have to see if you can get this done from the control panel. This is not alway the case though.

Tagged in : Tagged in : , ,
Jasper Frumau

Jasper has been working with web frameworks and applications such as Laravel, Magento and his favorite CMS WordPress including Roots Trellis and Sage for more than a decade. He helps customers with web design and online marketing. Services provided are web design, ecommerce, SEO, content marketing. When Jasper is not coding, marketing a website, reading about the web or dreaming the internet of things he plays with his son, travels or run a few blocks.