LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to run (whereis) ulimit in crontab ? (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-run-whereis-ulimit-in-crontab-4175427985/)

masuch 09-19-2012 09:40 AM

how to run (whereis) ulimit in crontab ?
 
Hi,

I am trying to run ulimit from crontab but I could not find where is ulimit located - whereis ulimit did not find anything.

Could please anybody help where is it or how to properly put it in crontab if it is some built-in command (where) ?

thank you,
kind regards,
M.

AlucardZero 09-19-2012 10:26 AM

ulimit is usually a shell builtin, not a binary

Have your cron job call a shell script that includes your ulimit and other commands

masuch 09-19-2012 11:19 AM

Quote:

Originally Posted by AlucardZero (Post 4784164)
ulimit is usually a shell builtin, not a binary

Have your cron job call a shell script that includes your ulimit and other commands

yes.

masuch 10-01-2012 06:43 AM

Can anybody please help to beginner how to solve it ?

crontab:
* * * * * /media/DATA/home/u1/bin/crontab/crontab-exec-script.sh /media/DATA/home/u1/bin/crontab/process-manager.sh all >> /var/log/_c-ROOT--process-manager.log 2>&1

crontab-exec-script.sh contains:
sh -c "/bin/bash; ulimit -t 1;'$shellscript'" # $shellscript is "/.../process-manager.sh" in this case

but I have got error:
/media/DATA/home/u1/bin/crontab/crontab-exec-script.sh: line 71: sh -c "/bin/bash; ulimit -t 1;/media/DATA/home/u1/bin/crontab/process-manager.sh": No such file or directory

"no such file or directory" message launched up because ulimit is builtin bash command. (without 'ulimit' it works properly.)


How 'sh -c "/bin/bash; ulimit -t 1;$shellscript" ' should look like ?


thank you very much for any clue,
kind regards,
Martin

masuch 05-20-2013 01:03 PM

just to close this thread.
using following:
/usr/bin/timeout --signal=SIGTERM --kill-after=10s 30s


All times are GMT -5. The time now is 11:39 PM.