added cleanCSV
This commit is contained in:
14
collect.py
14
collect.py
@@ -330,7 +330,18 @@ def run_debug():
|
||||
print(f"Error running midclt debug: {e}")
|
||||
return None
|
||||
|
||||
def cleanCSV():
|
||||
if is_debian():
|
||||
dir = "/var/log/proftpd"
|
||||
|
||||
if is_freebsd():
|
||||
dir = "/var/log"
|
||||
|
||||
for filename in os.listdir(dir):
|
||||
name = filename.absolute()
|
||||
if filename.endswith(".csv"): # Check for .csv extension
|
||||
os.remove(name)
|
||||
|
||||
def collect_csv():
|
||||
source_dir = os.getcwd()
|
||||
|
||||
@@ -506,7 +517,8 @@ def main():
|
||||
|
||||
# Upload data (replace with credentials and actual upload logic if needed)
|
||||
upload_debug()
|
||||
|
||||
cleanCSV()
|
||||
|
||||
print("Data collection and upload completed.")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user