set PATH to make sure find all commands when execute script from crontab

This commit is contained in:
Roger Pàmies Fabra 2023-07-26 01:04:47 +02:00
parent d6900f9e35
commit 56646e8083
6 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,8 @@
#!/bin/bash
# uncomment when use script from cron
PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
# variables
LOGFILE="$(hostname)_chkrootkit-$(date +'%Y-%m-%d').txt";
GOTIFY_MESSAGE="Scan init: **"`date +"%d/%m/%Y %H:%M:%S"`"** \r"

View File

@ -1,5 +1,8 @@
#!/bin/bash
# uncomment when use script from cron
PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
# variables
LOGFILE="$(hostname)_clamav-$(date +'%Y-%m-%d').log";
GOTIFY_MESSAGE="Scan init: **"`date +"%d/%m/%Y %H:%M:%S"`"** \r"

View File

@ -1,5 +1,8 @@
#!/bin/bash
# uncomment when use script from cron
PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
# variables
LOGFILE="$(hostname)_rkhunter-$(date +'%Y-%m-%d').log";
GOTIFY_MESSAGE="Scan init: **"`date +"%d/%m/%Y %H:%M:%S"`"** \r"

View File

@ -1,5 +1,8 @@
#!/bin/bash
# uncomment when use script from cron
PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
#verify run as root or sudo
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"

View File

@ -2,6 +2,9 @@
#Use ./gotifypush <title> <message> <priority> <token> <clickurl>
# uncomment when use script from cron
PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
# Gotify notification parameters
TITLE=$1
MESSAGE=$2

View File

@ -2,6 +2,9 @@
#Use ./logger.sh <logfile> <relativepath>
# uncomment when use script from cron
PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
# variables
REMOTE_PATH="$ES7_LOGS_PATH$2"
PUBLIC_LOG_URL="$ES7_LOGS_URL/$2"