COXIT-CO / ga_zoho_integration

Python script which integrates Zoho CRM deals data with google analytics.
0 stars 0 forks source link

Add script to cron job to start it automaticly on server update #43

Closed iramykytyn closed 3 years ago

BearVictor commented 3 years ago

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 ) image' It is means, that our script is working. When we go to log file ,we can see all actions