This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(0); | |
print("\n"); | |
$slashpos = strpos($argv[2], '/'); //get the position of the '/' in $argv[1] | |
$checkIP = $argv[1]; | |
$ip = substr($argv[2], 0, $slashpos); //Use this to break out the ip and cidr-number | |
//if the ip is shorter than 4 chars (x.x.x.x) or if the ip is logner than 16 chars xxx.xxx.xxx.xxx | |
//kill the script and tell user that ip is invalid | |
if(strlen($ip) > 15 || strlen($ip) < 7){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# README: This script is a log-archive tool wich compresses the logs in to weekly-archives and puts the Weekly archives in to monthly archives. | |
# README: The script also deletes the montly archives after a 6 months | |
# README: ------------------------------------------------------------------- | |
# README: How the script Works: | |
# README: Setup two Cron-jobs one weekly whch runs the script without any parameters | |
# README: And a monthly wich contains the parameter 'Monthly'. | |
#!/bin/bash | |
# Change directory to where the logs is stored (/storage/logs/apache/error) |