[TOOLS][Python] Remove SourceTV demos older than 5 days
Hi guys! I've recently made a python script, to remove old sourcetv/hltv records, because who needs records older than 5 days? It's script to those people who have their own dedicated server/VPS in every other case i'm sure that your hosting provider is doing it for you (;
It's reading date in format from csgo_demo_crash_fix plugin, in every other case it might not work so u're using it on your own risk (; Code:
import os1. Make python file and upload it on your dedicated server, name it like you like, for example: delete_demos.py and put in /home/csgo/ 2. Change path in variable demos_directory to yours, where your demos are stored, 3. chmod +x /home/csgo/delete_demos.py 4. crontab -e 5. write record in crontab like: */5 * * * * python /home/csgo/delete_demos.py 6. voila, your demos are gonna be deleted in every 5 minutes, when they are older than 5 days. |
Re: [TOOLS][Python] Remove SourceTV demos older than 5 days
Or if you are on linux:
Code:
find /path/ -type f -name "*.dem" -mtime +5 -delete |
Re: [TOOLS][Python] Remove SourceTV demos older than 5 days
Thanks for sharing. Alternately, I made a SM plugin to do just that a long time back:
https://forums.alliedmods.net/showthread.php?t=236027 Then, new server managers dont need to learn to use crontab and to chmod (although they should probably learn that anyways...). I have a more recent version (that one is 1.5 yrs old) that i'll upload soon (my wedding is in 5 days, so I'll do it later when I have time to update documentation, etc.). According to the changelog, here is the only difference between it and the above version (or at least that I remembered to write down): Code:
v4.0:
Spoiler
I'll try to get 4.0 on the website sometime in the next few weeks (I may need to be reminded after my wedding). |
Re: [TOOLS][Python] Remove SourceTV demos older than 5 days
i think in windows you can use forfiles
|
Re: [TOOLS][Python] Remove SourceTV demos older than 5 days
Quote:
Spoiler
|
Re: [TOOLS][Python] Remove SourceTV demos older than 5 days
Quote:
|
| All times are GMT -4. The time now is 18:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.