You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform version. In the case of Linux, please enter the Linux distribution you are using.
Debian 12
Steps
In a bash shell I try to calculate the free available space in my MEGA cloud; I have read the MEGA commands, but haven't find a command to get the free space as one single number to be used in bash scripts.
Expected behavior
I would like to get the free available space with just one command; currently I need to write
used=$( mega-df | grep "USED STORAGE:" | awk -F'[^0-9]' '$0=$2')
total=$(mega-df | grep "USED STORAGE:" | awk -F'[^0-9]' '$0=$5')
free=$((total-used))
However, mega-df and mega-du doesn't return the same value; e.g.
mega-df returns
USED STORAGE: 21051345911 39.21% of 53687091200
(Cloud drive=20309471541 + Rubbish bin=741874370 = 21051345911)
while mega-du returns 20304533872
Thank you for your help
Actual behavior
I have to calculate the free space by myself (see above)
mega-df and mega-du don't give the same result; I don't know which one should I use
The text was updated successfully, but these errors were encountered:
Thanks for the answer, but.... what is the right value that I should take as "used space" when calculating the remaining free space? Please look at this:
$ mega-du --versions
FILENAME SIZE S.WITH VERS
/: 20304533872 20309471541
Total storage used: 20304533872 20309471541
$
$ mega-df
Cloud drive: 20309471541 in 2243 file(s) and 233 folder(s)
Inbox: 0 in 0 file(s) and 0 folder(s)
Rubbish bin: 741874370 in 60 file(s) and 32 folder(s)
Incoming shares:
Berlino con papi: 1675361732 in 233 file(s) and 4 folder(s)
USED STORAGE: 21051345911 39.21% of 53687091200
Total size taken up by file versions: 4937669
In this case the remaining free space that I can use is (53687091200 - 20309471541) or (53687091200 - 21051345911)?
MEGAcmd version
1.7.0
Operating System/Platform
Linux
Platform version. In the case of Linux, please enter the Linux distribution you are using.
Debian 12
Steps
In a bash shell I try to calculate the free available space in my MEGA cloud; I have read the MEGA commands, but haven't find a command to get the free space as one single number to be used in bash scripts.
Expected behavior
I would like to get the free available space with just one command; currently I need to write
used=$( mega-df | grep "USED STORAGE:" | awk -F'[^0-9]' '$0=$2')
total=$(mega-df | grep "USED STORAGE:" | awk -F'[^0-9]' '$0=$5')
free=$((total-used))
However, mega-df and mega-du doesn't return the same value; e.g.
mega-df returns
USED STORAGE: 21051345911 39.21% of 53687091200
(Cloud drive=20309471541 + Rubbish bin=741874370 = 21051345911)
while mega-du returns 20304533872
Thank you for your help
Actual behavior
The text was updated successfully, but these errors were encountered: