Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_current_shell_and_path_to_crontab #1

Open
dimti opened this issue May 24, 2015 · 1 comment
Open

add_current_shell_and_path_to_crontab #1

dimti opened this issue May 24, 2015 · 1 comment

Comments

@dimti
Copy link

dimti commented May 24, 2015

Hello

I try to use your script for get default bash env in cron (I found solution from http://stackoverflow.com/questions/2388087/how-to-get-cron-to-call-in-the-correct-paths)

In my crontab, after execute that script, removed some lines (Comments and may be wrong records)

Comments moved to begin of the crontab file (edited)

[*] Current SHELL: /bin/bash                                                                                                                           [1/276]
[*] Current PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[*] Adding current SHELL and PATH to crontab 
old crontab:
-------------------------------------------------------------------------------------------------------------------------------
MAILTO=dimti@bk.ru
12      0       *       *       *       /usr/local/ispmgr/sbin/update.sh ispmgr >/dev/null 2>&1
23      *       *       *       *       /usr/local/ispmgr/sbin/rotate
44      17      *       *       *       /usr/local/ispmgr/sbin/traffic.pl

* */12 * * *    find /var/www/all/data/mod-tmp/ -cmin +30 -name "sess_*" -delete
*/5 * * * *     /usr/local/ispmgr/sbin/cron.sh sbin/eximquota.check.sh
*/30    *       *       *       *       /usr/local/ispmgr/sbin/dbcache
10 0 * * *      /usr/local/ispmgr/sbin/cron.sh sbin/mgrctl -m ispmgr task.daily
9 2 * * *       /usr/local/ispmgr/sbin/cron.sh sbin/update.sh ispmgr
*/5 * * * *     /usr/local/ispmgr/sbin/cron.sh sbin/ihttpd.check.sh
#*/5 * * * *    /usr/sbin/logrotate /etc/logrotate.d/error-log-custom
0 6 * * *       /usr/sbin/logrotate -f /var/www/all/data/www/zelenoemore.ru/serverconfigs/predelanet/logrotate/zelenoemore.custom.error.log.conf
#*/10 * * * *   truncate --size=0 /var/www/all/data/www/predelanet.ru/cache/face/error.log
#*/10 * * * *    truncate --size=0 /var/www/all/data/www/zelenoemore.ru/cache/face/error.log
*/5 * * * * env - PATH="$PATH" /root/redis-auto-restart.sh
-------------------------------------------------------------------------------------------------------------------------------
[*] New crontab:
-------------------------------------------------------------------------------------------------------------------------------
#*/5 * * * *    /usr/sbin/logrotate /etc/logrotate.d/error-log-custom
#*/10 * * * *   truncate --size=0 /var/www/all/data/www/predelanet.ru/cache/face/error.log
#*/10 * * * *    truncate --size=0 /var/www/all/data/www/zelenoemore.ru/cache/face/error.log
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

MAILTO=dimti@bk.ru
12      0       *       *       *       /usr/local/ispmgr/sbin/update.sh ispmgr >/dev/null 2>&1
23      *       *       *       *       /usr/local/ispmgr/sbin/rotate
44      17      *       *       *       /usr/local/ispmgr/sbin/traffic.pl

* */12 * * *    find /var/www/all/data/mod-tmp/ -cmin +30 -name "sess_*" -delete
*/5 * * * *     /usr/local/ispmgr/sbin/cron.sh sbin/eximquota.check.sh
*/30    *       *       *       *       /usr/local/ispmgr/sbin/dbcache
10 0 * * *      /usr/local/ispmgr/sbin/cron.sh sbin/mgrctl -m ispmgr task.daily
9 2 * * *       /usr/local/ispmgr/sbin/cron.sh sbin/update.sh ispmgr
*/5 * * * *     /usr/local/ispmgr/sbin/cron.sh sbin/ihttpd.check.sh
0 6 * * *       /usr/sbin/logrotate -f /var/www/all/data/www/zelenoemore.ru/serverconfigs/predelanet/logrotate/zelenoemore.custom.error.log.conf
-------------------------------------------------------------------------------------------------------------------------------
@dimti
Copy link
Author

dimti commented May 24, 2015

Oh. Sorry. I not see - Comments moved to begin of crontab file

@dimti dimti changed the title add_current_shell_and_path_to_crontab - removes some records in crontab add_current_shell_and_path_to_crontab May 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant