Magento 2 - clean up files before backup
It might be a good idea to decrease Magento size on disk and number of files before doing a backup. This way your backups will be smaller and faster and the restore will take less time.
Using a command: ( from Magento 2 root directory )
du -a . | sort -n -r | head -n 20
Will show you which files / directories take up most of your space
In our case it was
So repeating the command
du -a var | sort -n -r | head -n 20
Will show what directories take space inside the var directory.
In our case we had a lot of imports and exports and some cache and logs:
You can repeat the above for the /pub directory
du -a pub | sort -n -r | head -n 20
Next thing to do would be to delete some unused images - You can see our post on how to do that:
It is a good idea to setup cron job to clean up the cron.log inside Magento root/var/log ( We will soon add more information about that )