Skip to content

Commit e355e78

Browse files
authored
Update logs.py
1 parent acb6ecb commit e355e78

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

logs.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
logsdir="c:\puttylogs" # Set the Variable logsdir
1616
zip_program="zip.exe" # Set the Variable zip_program - 1.1
1717

18-
for files in os.listdir(logsdir): # Find all the files in the directory
19-
if files.endswith(".log"): # Check to ensure the files in the directory end in .log
20-
files1=files+"."+strftime("%Y-%m-%d")+".zip" # Create the Variable files1, this is the files in the directory, then we add a suffix with the date and the zip extension
21-
os.chdir(logsdir) # Change directory to the logsdir
22-
os.system(zip_program + " " + files1 +" "+ files) # Zip the logs into dated zip files for each server. - 1.1
23-
os.remove(files) # Remove the original log files
18+
for files in os.listdir(logsdir): # Find all the files in the directory
19+
if files.endswith(".log"): # Check to ensure the files in the directory end in .log
20+
files1 = files + "." + strftime("%Y-%m-%d") + ".zip" # Create the Variable files1, this is the files in the directory, then we add a suffix with the date and the zip extension
21+
os.chdir(logsdir) # Change directory to the logsdir
22+
os.system(zip_program + " " + files1 +" "+ files) # Zip the logs into dated zip files for each server. - 1.1
23+
os.remove(files) # Remove the original log files

0 commit comments

Comments
 (0)