Tag Info

Hot answers tagged


In order to set the desired environment variables you need to source the .bash_profile file with . /home/some_user/.bash_profile. In your case, you are executing the bash_profile file, which will basically execute that file and exit the shell. The next time some_script is run it will start with fresh environment variables. Check this link - sourcing vs ...


incrond (inotify cron daemon) behaves like cron but uses inotify as the triggering mechanism. This guide has some pretty comprehensive examples. An example incron entry for the case you described might be: /path/to/file IN_CLOSE_WRITE /path/to/your_script


Cronjob for both log & email : Run once a month at midnight of the first day of the month: 0 0 1 * * 0 0 1 * * /home/User/script.sh > /home/User/cronlog/`date +\%Y-\%m-\%d-\%H:\%M:\%S`-cron.log 2>&1 ; mailx -s "CronJob is run successfully" someone@domain.com,someone1@domain.com

Only top voted, non community-wiki answers of a minimum length are eligible