free.py
Kod: Markera allt
#!/usr/bin/python
import os
#os.popen('df -h /media/C > free_c.txt')
f = open('/etc/fstab', 'r')
for line in f:
if line[0]!='#':
line=line.split(' ')
if len(line)>1:
if line[1]!='none':
#print line[1]
command="df -h "+line[1]
#print command
os.popen("df -h "+line[1]+" >temp.txt")
temp=open('temp.txt','r')
temp.readline()
output=temp.readline()
output=output.split()
print line[1]+" "+output[3]
Kod: Markera allt
${execi 86400 python /home/marcus/scripts/free.py}