bash - How to run a script every hour that has some commands which need password? -


i working on cloud desktop , trying execute ./parsescript.sh has following command: sudo -u identmon /apollo/env/parisoperationaltools/scripts/get/callretryoffai‌​lures.rb "$apiname" "$requestinput" –

i want call script every hour doing using following commands:

step 1. connect cloud desktop using ssh. step 2. run these commands: % screen % while true; ./parsescript.sh; sleep 3600; done step 3. close window running command. step 4. (same step 1) connect cloud desktop using ssh. step 5. run command: screen -r. session left in step 3. 

now problem in script have 1 command mentioned above, has executed using sudo -u identmon, hence ask password every time, there anyway run script every hour except manually?

the easiest way add nopasswd option sudors file can check here https://askubuntu.com/questions/147241/execute-sudo-without-password

username all=(all) nopasswd: 

that said carefull adding no password sudo.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -