vetzki
Philosoph
- 1.750
Hallo, evtl. nutzt es mal jemand anderem, um sich die Ordner und/oder Dateien welche den meisten Speicherplatz brauchen anzeigen zu lassen, z.b.:
edit 15.02: etwas netter
Code:
DirsFilesJS (89)
A1: Test File [ Type:Type Data:/system/bin/du Store Result In:%duda Use Root:Off ]
<find nur mit toybox oder busybox>
A2: Test File [ Type:Type Data:/system/bin/find Store Result In:%findda Use Root:Off ]
<ggf ohne find wenn nicht benötigt>
A3: If [ %duda Set & %findda Set ]
A4: Run Shell [ Command:du --help Timeout (Seconds):0 Use Root:Off Store Output In: Store Errors In:%duHelp Store Result In: Continue Task After Error:On ] If [ %duHelp !Set ]
A5: Run Shell [ Command:find --help Timeout (Seconds):0 Use Root:Off Store Output In:%findHelp Store Errors In: Store Result In: ]
<nicht zu wenig, shell und js timeout>
A6: Variable Set [ Name:%tskshtimeout To:240 Do Maths:Off Append:Off ]
<Wieviel soll angezeigt werden>
A7: Variable Set [ Name:%tskhowmuch To:25 Do Maths:On Append:Off ]
<wo gesucht werden soll>
A8: Variable Set [ Name:%tskplace To:/data/app/ Do Maths:Off Append:Off ]
<shell kommando>
A9: Variable Set [ Name:%tskcmd To:du -m -d 1 %tskplace Do Maths:Off Append:Off ]
<sh als root ausfuehren (true/false)>
A10: Variable Set [ Name:%tskrootsh To:true Do Maths:Off Append:Off ]
A11: JavaScriptlet [ Code:function sh(cmd, root) {
var root = (root == "true") ? true : false
var str = shell( cmd, root, parseInt(tskshtimeout)).split("\n");
return( (cmd[0] == "d" ? str.sort(function(a, b) { return parseInt(b) - parseInt(a) }).slice(1, parseInt(tskhowmuch)+1) : str.sort(function(a, b) { return parseInt(b) - parseInt(a) }).slice(0, parseInt(tskhowmuch)) ) );
}
var stdout = "Am meisten Platz in "+tskplace+" belegen:\n" + sh(tskcmd, tskrootsh).join("\n").toString(); Libraries: Auto Exit:On Timeout (Seconds):%tskshtimeout ]
A12: Variable Set [ Name:%DataApp To:%stdout Do Maths:Off Append:Off ]
A13: Variable Set [ Name:%tskplace To:/data/data/ Do Maths:Off Append:Off ]
A14: Variable Set [ Name:%tskcmd To:du -m -d 1 %tskplace Do Maths:Off Append:Off ]
A15: JavaScriptlet [ Code:function sh(cmd, root) {
var root = (root == "true") ? true : false
var str = shell( cmd, root, parseInt(tskshtimeout)).split("\n");
return( (cmd[0] == "d" ? str.sort(function(a, b) { return parseInt(b) - parseInt(a) }).slice(1, parseInt(tskhowmuch)+1) : str.sort(function(a, b) { return parseInt(b) - parseInt(a) }).slice(0, parseInt(tskhowmuch)) ) );
}
var stdout = "Am meisten Platz in "+tskplace+" belegen:\n" + sh(tskcmd, tskrootsh).join("\n").toString(); Libraries: Auto Exit:On Timeout (Seconds):%tskshtimeout ]
A16: Variable Set [ Name:%DataData To:%stdout Do Maths:Off Append:Off ]
A17: Variable Set [ Name:%tskplace To:/sdcard/ Do Maths:Off Append:Off ]
A18: Variable Set [ Name:%tskcmd To:du -m -d 1 %tskplace Do Maths:Off Append:Off ]
A19: Variable Set [ Name:%tskrootsh To:false Do Maths:Off Append:Off ]
A20: JavaScriptlet [ Code:function sh(cmd, root) {
var root = (root == "true") ? true : false
var str = shell( cmd, root, parseInt(tskshtimeout)).split("\n");
return( (cmd[0] == "d" ? str.sort(function(a, b) { return parseInt(b) - parseInt(a) }).slice(1, parseInt(tskhowmuch)+1) : str.sort(function(a, b) { return parseInt(b) - parseInt(a) }).slice(0, parseInt(tskhowmuch)) ) );
}
var stdout = "Am meisten Platz in "+tskplace+" belegen:\n" + sh(tskcmd, tskrootsh).join("\n").toString(); Libraries: Auto Exit:On Timeout (Seconds):%tskshtimeout ]
A21: Variable Set [ Name:%Sdcard To:%stdout Do Maths:Off Append:Off ]
<größtes Verzeichnis (von %Sdcard)>
A22: JavaScriptlet [ Code:function splitit(tskvar) {
var arr = global(tskvar).split(":").pop().split("\n")
var arra = arr[1].split("/")
return "/"+arra[1]+"/"+arra[2]
}
var where = splitit("Sdcard") Libraries: Auto Exit:On Timeout (Seconds):%tskshtimeout ]
A23: Variable Set [ Name:%tskplace To:%where Do Maths:Off Append:Off ]
<Nur Dateien, zweimal \ wegen js>
A24: Variable Set [ Name:%tskcmd To:find %tskplace -type f -exec du -m {} \\; Do Maths:Off Append:Off ]
A25: JavaScriptlet [ Code:function sh(cmd, root) {
var root = (root == "true") ? true : false
var str = shell( cmd, root, parseInt(tskshtimeout)).split("\n");
return( (cmd[0] == "d" ? str.sort(function(a, b) { return parseInt(b) - parseInt(a) }).slice(1, parseInt(tskhowmuch)+1) : str.sort(function(a, b) { return parseInt(b) - parseInt(a) }).slice(0, parseInt(tskhowmuch)) ) );
}
var stdout = "Am meisten Platz in "+tskplace+" belegen:\n" + sh(tskcmd, tskrootsh).join("\n").toString(); Libraries: Auto Exit:On Timeout (Seconds):%tskshtimeout ]
A26: Variable Set [ Name:%SdcardDirXFiles To:%stdout Do Maths:Off Append:Off ]
A27: Variable Set [ Name:%LastRun To:%DATE-%TIME Do Maths:Off Append:Off ]
A28: Else
A29: Notify [ Title:!! du oder find fehlt !! Text: Icon:null Number:0 Permanent:Off Priority:3 ]
edit 15.02: etwas netter
Anhänge
Zuletzt bearbeitet: