Crontab script
Schedule a script "removelogs" in a CRON job. We have to make this a script and run with the full path
Also please make sure to source the environment before running this. Not sure what sourcing means and how to achieve it. TO run the script manually it needs to be run as ". ./removelogs" from its directory. Adding the ERROR from mailer spool ../pkms.env is missing. Please run cron_removelogs from the scripts dir Where cron_removelogs = FIle which invokes the script: cat cron_removelogs #!/bin/sh . /home/admin/.bash_profile # Source the Environment redit # Run the removelogscores script . /<path to actual script>/removelogs And the path for alias "redit" is mentinoed in /home/admin/.bash_profile |
1. show us what you've got so far
2. use code tags https://www.linuxquestions.org/quest...do=bbcode#code 3. sourceing means pulling code into the current env either by using Code:
# this is <dot><space>somefile as per your Useful links you should read http://rute.2038bug.com/index.html.gz http://tldp.org/LDP/Bash-Beginners-G...tml/index.html http://www.tldp.org/LDP/abs/html/ http://www.adminschoice.com/crontab-quick-reference |
In simple words, sourcing means to load or set what is mentioned in specified file line-by-line. So,
Code:
. /<path to actual script>/removelogs Similarly, Code:
. /home/admin/.bash_profile I suppose, your script (which has to be scheduled in cron) is cron_removelogs, not removelogs file. Anyway, let's know what problem you're facing? |
All times are GMT -5. The time now is 11:07 PM. |