A script to quickly compress the Magento 2 public folder without the complied files, such as generated, static etc.
If moving you will need to deploy afterwards to regenerate the files we have not compressed and moved.
tar --exclude=./generated/code --exclude=./pub/static --exclude=./generated/metadata --exclude=./var/cache --exclude=./var/composer_home --exclude=./var/page_cache --exclude=./var/view_preprocessed --exclude ./pub/media/catalog/product/cache --exclude ./var/log -zcvf backup-lite.tar.gz .
Excludes the following when backing up
|Contains generated code|
|Contains the compiled dependency injection configuration for all modules.|
|All cacheable objects except the page cache. This directory is empty if you use a third-party cache storage such as Redis.|
|Home directory for Setup Wizard artifacts. Do not touch this directory unless you are an experienced developer familiar with the Magento plug-in system.|
|Cached pages from the full page cache mechanism. This directory is empty if you use a third-party HTTP accelerator such as Varnish.|
|Contains minified templates and compiled LESS (meaning LESS, CSS, and HTML).|
|pub/media/catalog/product/cache||Cached product images|
|var/log||Logging information ie system and exception|