#!/bin/bash #################################################################################################### #### author: SlickStack ############################################################################ #### link: https://slickstack.io ################################################################### #### mirror: http://mirrors.slickstack.io/bash/ss-reset-logs.txt ################################### #### path: /var/www/bash/ss-reset-logs ############################################################# #### destination: n/a (not a boilerplate) ########################################################## #### purpose: Resets all SlickStack module log files to be NULL (empty) to clear history ########### #### module version: n/a ########################################################################### #### sourced by: ss-install ######################################################################## #### bash aliases: ss reset logs, ss clear logs, ss null logs ###################################### #################################################################################################### ## include SlickStack configuration ## source /var/www/ss-config ## include SlickStack functions ## source /var/www/ss-functions #################################################################################################### #### SS-Reset-Logs: Message (Begin Script) ######################################################### #################################################################################################### ## this is a simple message that announces to the shell the purpose of this bash script ## ## it will only be noticed by sudo users who manually call ss core bash scripts ## ## echo message ## echo -e "${PURPLE}Running ss-reset-logs: Resets all SlickStack module log files to be NULL (empty) to clear history... ${NOCOLOR}" sleep "$SLEEP_MESSAGE_BEGIN" #################################################################################################### #### SS-Reset-Logs: NULL All Log Files ############################################################# #################################################################################################### ## null log files ## cat /dev/null > /var/www/logs/clamav.log cat /dev/null > /var/www/logs/cron.log cat /dev/null > /var/www/logs/error.log cat /dev/null > /var/www/logs/mysql*.log cat /dev/null > /var/www/logs/nginx.log cat /dev/null > /var/www/logs/redis.log #################################################################################################### #### SS-Reset-Logs: Touch Timestamp File (End Script) ############################################## #################################################################################################### ## this is a dummy timestamp file that will remember the last time this script was run ## ## it can be useful for developer reference and is sometimes used by SlickStack ## ## script timestamp ## touch /var/www/meta/.timestamp-ss-reset-logs #################################################################################################### #### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ############### #################################################################################################### ## Ref: ## SS_EOF