#!/bin/bash #################################################################################################### #### author: SlickStack ############################################################################ #### link: https://slickstack.io ################################################################### #### mirror: http://mirrors.slickstack.io/bash/ss-perms-ubuntu-crontab.txt ######################### #### path: /var/www/ss-perms-ubuntu-crontab ######################################################## #### destination: n/a (not a boilerplate) ########################################################## #### purpose: Resets file and user permissions for the root crontab and related files ############## #### module version: WordPress 5.5.x ############################################################### #### sourced by: ss-perms, ss-install-wordpress-core ############################################### #### bash aliases: ss perms ubuntu crontab, ss perms crontab ####################################### #################################################################################################### ## include SlickStack configuration ## source /var/www/ss-config ## include SlickStack functions ## source /var/www/ss-functions #################################################################################################### #### SS-Perms-Ubuntu-Crontab: 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-perms-ubuntu-crontab: Resets file and user permissions for the root crontab and related files... ${NOCOLOR}" sleep "$SLEEP_MESSAGE_BEGIN" #################################################################################################### #### SS-Perms: Reset Permissions (ClamAV) ########################################################## #################################################################################################### ## reset permissions ## chown root:root /var/spool/cron/crontabs/root ## must be root:root chmod 0600 /var/spool/cron/crontabs/root ## must be exactly 0600 or crontab will fail if [ ! -f "/var/www/logs/cron.log" ]; then touch "/var/www/logs/cron.log"; fi chown root:root /var/www/logs/cron*.log* chmod 0644 /var/www/logs/*.log ## 6755 should also work #################################################################################################### #### SS-Perms-Ubuntu-Crontab: 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-perms-ubuntu-crontab #################################################################################################### #### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ############### #################################################################################################### ## Ref: ## SS_EOF