So, first of all i created script file (.sh) in our directory ( /home/ubuntu/workspace/ga_zoho_integration_2) called it "ga_zoho.sh
In this file we have next code:
#!/bin/bash
cd /home/ubuntu/workspace/ga_zoho_integration_2
sudo python2.7 main.py....(our parameters)
Next i use "cron" :
first open cron file - crontab -e
then write command like this
@reboot bash /home/ubuntu/workspace/ga_zoho_integration_2/ga_zoho.sh
this command says that : when server reboot we start script in directory.
After rebooting server we can use command ps aux and watch ( photo )
'
It is means, that our script is working.
When we go to log file ,we can see all actions
So, first of all i created script file (.sh) in our directory ( /home/ubuntu/workspace/ga_zoho_integration_2) called it "ga_zoho.sh In this file we have next code:
Next i use "cron" : first open cron file -
crontab -e
then write command like this@reboot bash /home/ubuntu/workspace/ga_zoho_integration_2/ga_zoho.sh
this command says that : when server reboot we start script in directory. After rebooting server we can use commandps aux
and watch ( photo ) ' It is means, that our script is working. When we go to log file ,we can see all actions