In this guide, I will show you how to create Password Protected ZIPs in Ubuntu using the 7zip package.
In order to follow this tutorial, you will need the following
Update Package list
Before installing any new packages, it is always good idea to update your package list. You can do this by typing:
sudo apt-get update
sudo apt-get install p7zip-full
After you have done this, 7zip should be installed.
To use this to create a password protected zip file, you can use the following command - Make sure to replace the password with your own (you can use special characters) and the correct directory.
7za a -tzip -p'PASSWORD HERE' -mem=AES256 "/place/to/store/backups/backup.zip" /directory/* -R
You can also include the date in the file name like this
7za a -tzip -p'PASSWORD HERE' -mem=AES256 "/place/to/store/backups/$(date +%d-%m-%Y).zip" /directory/* -R