Author
|
|
Senior Member
Join Date: Feb 2011
Location: The Observatory
|
Plugin ID:
|
4484
|
Plugin Version:
|
2.0.0
|
Plugin Category:
|
Server Management
|
Plugin Game:
|
Team Fortress 2
|
Plugin Dependencies:
|
|
Servers with this Plugin:
|
|
| |
Plugin Description:
|
Deletes old replay files based on specified settings
|
|
|
01-09-2015
, 16:50
[TF2] Http Replay Cleaner Redux
|
#1
|
[TF2] Replay Cleaner Redux
Version 2.0.0
Original by DarthNinja : https://forums.alliedmods.net/showthread.php?t=157867
Description:
Replays taking up way too much space on your HTTP server? You need this!
With this plugin, replay files older then a set number of days are automatically deleted when the replay folder exceeds a set disk usage quota.
This version was posted with permission by Darth, it has been redesigned to use a Curl post rather than forcing a quiet MOTD on clients, it sends everything via post and now has a security key cvar in order to keep things secure.
Commands:
Cvars:
- sm_replaycleanup_version
- sm_replaycleanup_enable
- Enable/Disable the plugin.
- Default: 1
- sm_replaycleanup_cachesize
- The amount of space in MB that replays must be using before any will be deleted.
- Default: 1024 (aka, 1 GB)
- sm_replaycleanup_days
- Files older than this many days will be deleted.
- Default: 4
- sm_replaycleanup_link
- sm_replaycleanup_localpath
- Location of your replay files relative to the php script.
- Eg, tf/2/
- sm_replaycleanup_save_logfile
- Should a log file be saved to CleaningSessions.log on the webserver?
- Default: 1
- sm_replaycleanup_autoprune
- The time in hours to attempt to auto-prune replays (for servers that don't have rounds).
- Default: 0 (Disabled)
- sm_replaycleanup_secretkey
- Your secret key to keep people from posting to your page.
Install Instructions:
- Upload the php script to a folder above where the replay files are stored.
- Chmod the folder with php script and the folders that have the replay files to 777.
- Edit the replaycleaner.php file to add in your secret key. You only need to edit the top line.
-
Code:
//EDIT THIS ONLY
$secret_key = "";
//DO NOT EDIT ANYTHING ELSE
- Install the plugin
- When loaded, the plugin will create a config file at tf/cfg/sourcemod/HTTPReplayCleanup.cfg
Set the above cvars in the config file.
- Restart the server or change maps to reload the config.
Example Setup:
- Your replay files are saved to http://yoursite.com/tf2/replays/server1/.
- You could drop the php file in the /tf2/ folder and name it "cleanup.php".
- You would then set sm_replaycleanup_link to "www.yoursite.com/tf2/cleanup.php".
- You would then set sm_replaycleanup_localpath to "replays/server1/"
Notes:
- Files are deleted at the end of each round.
- Example Logfile:
Code:
Session started - Fri, 27 May 2011 19:14:44 CDT
The total filesize of "teamfortress/server1/" is: 500.89 MB. Maximum 500 MB allowed
Deleting files from more than 1 days ago:
---------------------
Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_15.block - 83.79KB - Thu, 26 May 2011 19:14:08 CDT
Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_11.block - 97.25KB - Thu, 26 May 2011 19:13:08 CDT
Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_10.block - 84.62KB - Thu, 26 May 2011 19:12:53 CDT
Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_12.block - 83KB - Thu, 26 May 2011 19:13:22 CDT
-Snip-
Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_13.block - 90.48KB - Thu, 26 May 2011 19:13:38 CDT
Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_17.block - 84.61KB - Thu, 26 May 2011 19:14:37 CDT
Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_16.block - 85.87KB - Thu, 26 May 2011 19:14:23 CDT
Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_14.block - 98.27KB - Thu, 26 May 2011 19:13:53 CDT
---------------------
Total files deleted: 788 - The NEW total filesize of "teamfortress/server1/" is: 300.2MB.
Version History:
- V1.0.0
- V1.1.1
- Fixed a potential infinite loop if the round ends and there are no human players.
- Added a cvar to make the plugin prune replays via a timer
- V2.0.0
- Resigned to use a Curl post rather than an Motd open
- Added the cvar sm_replaycleanup_secretkey which needs to be set on both ends in order to maintain security
__________________
Last edited by rowedahelicon; 01-09-2015 at 17:05.
|
|
|
|