A script to keep your mega account(s) alive and print their used storage info
(df -h
).
Automatically logs every run in the ~/keep-mega-alive.log
file (since v1.2)
Get it from https://mega.io/cmd or using APT
The advantage of doing it this way is that updates of MEGAcmd will be automatically fetched and installed when you upgrade your packages.
Add the MEGA signing key for the repository
curl -fsSL https://mega.nz/keys/MEGA_signing.key | sudo apt-key add -
Add the repo, replace <OS>
with your OS version path found under
https://mega.nz/linux/MEGAsync/
sudo echo "deb https://mega.nz/linux/MEGAsync/<OS>/ ./" > /etc/apt/sources.list.d/mega-nz.list
Then just install it
sudo apt update
sudo apt install megacmd
From your home directory (~
), download the latest version of the script and
make it executable
curl -O https://raw.githubusercontent.com/3ncod3/keep-mega-alive/main/keep-mega-alive.sh
chmod u+x keep-mega-alive.sh
Create a mega-logins.csv
CSV file with your mega logins, with each email and
password being separated by a comma and on a separate line, under your home
directory like so:
[email protected],password1
[email protected],password2
[email protected],password3
For Windows, download and use the keep-mega-alive.bat
file instead of the
keep-mega-alive.sh
file everywhere.
https://raw.githubusercontent.com/3ncod3/keep-mega-alive/main/keep-mega-alive.bat
Upgrade your current version of the script by simply re-downloading it
curl -O https://raw.githubusercontent.com/3ncod3/keep-mega-alive/main/keep-mega-alive.sh
chmod u+x keep-mega-alive.sh
Once you have created mega-logins.csv
in your home directory and the script is
executable (see Installation), just run it:
~/keep-mega-alive.sh
By default, the script is going look for the mega-logins.csv
file under the
same directory the script resides under but you can specify a path to this file
like so:
~/keep-mega-alive.sh path/to/logins-file.csv
You can use crontab
to schedule the
script to run at a regular interval by adding an entry to your cronfile (run
crontab -e
).
0 0 1 * * path/to/keep-mega-alive.sh &>/dev/null
0 0 1 */2 * path/to/keep-mega-alive.sh &>/dev/null
0 0 1 */3 * path/to/keep-mega-alive.sh &>/dev/null
The script logs everything in the file keep-mega-alive
in your home directory. If you want to look at unsuccessful login attempts run
cat ~/keep-mega-alive.log | grep ERROR
Find your script version by running
~/keep-mega-alive.sh --version