Freeing up space in server disk

Freeing up space in server disk

Backup databases and free up disk space

  1. Make sure you’ve followed the steps in https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/1484455942.

  2. In your local machine, create a directory to temporarily store the backups, such as /backups/prod and /backups/beta.

  3. Cd to the directory you just created, and run scp -r lfbeta:~/backups . or scp -r lfprod:~/backups .  This will copy all the backup files in the server to your local machine (it might take a while depending on how many files there are).

  4. Go to https://drive.google.com/drive/folders/1hJekoxGgIt9qC30nbjZnQlGCsol8BBPU and upload the files stored in your local machine to the corresponding folder.

  5. Once everything has been correctly backed up, connect to either beta or prod through SSH running ssh lfprod or ssh lfbeta. If you haven’t setup the SSH access described above you can also do this by connecting to the server through DigitalOcean.

  6. In the server’s terminal, run cd /home/litefarm/backups.

  7. Run find . -type f -mtime +10. This should show all backup files older than 10 days. Check if this looks right, these are the files we want to get rid of.

  8. Run find . -type f -mtime +10 -delete (careful, this will actually delete the files!).

  9. If you go to DigitalOcean, click on the server and see “Disk usage” you should see the percentage lowering after a while.