mirror of
https://github.com/vale981/dirkules
synced 2025-03-05 09:21:38 -05:00
added sudo
This commit is contained in:
parent
187f437988
commit
2912bcc358
3 changed files with 6 additions and 6 deletions
|
@ -5,7 +5,7 @@ import subprocess
|
||||||
def autoclean(path):
|
def autoclean(path):
|
||||||
# remove all files older than 180 days
|
# remove all files older than 180 days
|
||||||
find = subprocess.Popen([
|
find = subprocess.Popen([
|
||||||
"find \"" + path +
|
"sudo find \"" + path +
|
||||||
"\" -type f -mtime +180 -delete -exec echo {} \\;"
|
"\" -type f -mtime +180 -delete -exec echo {} \\;"
|
||||||
],
|
],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
|
|
@ -8,7 +8,7 @@ import subprocess
|
||||||
def get_space(label):
|
def get_space(label):
|
||||||
lines = list()
|
lines = list()
|
||||||
btrfs_usage = subprocess.Popen(
|
btrfs_usage = subprocess.Popen(
|
||||||
["btrfs fi usage -b -T " + label],
|
["sudo btrfs fi usage -b -T " + label],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
shell=True,
|
shell=True,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
|
@ -35,7 +35,7 @@ def get_space(label):
|
||||||
def get_raid(label):
|
def get_raid(label):
|
||||||
lines = list()
|
lines = list()
|
||||||
btrfs_usage = subprocess.Popen(
|
btrfs_usage = subprocess.Popen(
|
||||||
["btrfs fi usage -T " + label],
|
["sudo btrfs fi usage -T " + label],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
shell=True,
|
shell=True,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
|
|
|
@ -11,7 +11,7 @@ def get_all_drives():
|
||||||
]
|
]
|
||||||
|
|
||||||
lsblk = subprocess.Popen(
|
lsblk = subprocess.Popen(
|
||||||
["lsblk -I 8 -d -b -o NAME,MODEL,SERIAL,SIZE,ROTA,RM,HOTPLUG"],
|
["sudo lsblk -I 8 -d -b -o NAME,MODEL,SERIAL,SIZE,ROTA,RM,HOTPLUG"],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
shell=True,
|
shell=True,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
|
@ -46,7 +46,7 @@ def get_all_drives():
|
||||||
|
|
||||||
def get_smart(device):
|
def get_smart(device):
|
||||||
passed = False
|
passed = False
|
||||||
smartctl = subprocess.Popen(["smartctl -H " + device],
|
smartctl = subprocess.Popen(["sudo smartctl -H " + device],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
shell=True,
|
shell=True,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
|
@ -69,7 +69,7 @@ def part_for_disk(device):
|
||||||
keys = ['name', 'label', 'fs', 'size', 'uuid', 'mount']
|
keys = ['name', 'label', 'fs', 'size', 'uuid', 'mount']
|
||||||
device = "/dev/" + device
|
device = "/dev/" + device
|
||||||
lsblk = subprocess.Popen(
|
lsblk = subprocess.Popen(
|
||||||
["lsblk " + device + " -l -b -o NAME,LABEL,FSTYPE,SIZE,UUID,MOUNTPOINT"],
|
["sudo lsblk " + device + " -l -b -o NAME,LABEL,FSTYPE,SIZE,UUID,MOUNTPOINT"],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
shell=True,
|
shell=True,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
|
|
Loading…
Add table
Reference in a new issue