Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cronjob: Pull data from stats.vlabs.ac.in service and POST the usage #42

Open
sivashankerN opened this issue Feb 5, 2018 · 6 comments

Comments

@sivashankerN
Copy link

Cronjob: Pull data from stats.vlabs.ac.in service.

Analytics-service has to get/pull the data from "[email protected]:/var/www/html/analytics/output.txt" and put it in /root/nonopenedx-usage.txt.

Once analytics-service gets the data from stats.vlabs.ac.in, POST the collected data into analytics-service( i.e localhost ) .

@sivashankerN
Copy link
Author

Cronjob for pulling the data from stats.vlabs.ac.in

0 22 * * * rsync -avz [email protected]:/var/www/html/analytics/output.txt /root/nonopenedx-usage.txt

Cronjob for POST

0 23 * * * curl -X POST http://analytics.vlabs.ac.in/nonopenedx/add_usage

@sivashankerN
Copy link
Author

Cronjobs are set using the following command
crontab -e from the root account.

@sivashankerN
Copy link
Author

Modification in conjobs

0 */1 * * * rsync -avz [email protected]:/var/www/html/analytics/output.txt /root/nonopenedx-usage.txt
5 */1 * * * curl -X POST http://analytics.vlabs.ac.in/nonopenedx/add_usage

@sivashankerN
Copy link
Author

That means
Every one-hour rsync happens ( gets data)
Every one-hour and five minutes POST happens. ( Post data)

@sivashankerN
Copy link
Author

need change cronjobs again, since, in stats server rsync happens every 6 hours, so in analytics service we need to set cronjobs at least every 7 hous as @ksripathi said

@sivashankerN
Copy link
Author

Checked cronjobs in stats server.

20 * * * * cd /root/analytics-erlang-program; erl -noshell -s analytics main -s init stop >>output.log 2>&1 </dev/null
40 * * * * cd /var/www/html/analytics/; python script.py

So, as we set cronjobs in analytics-service, that is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant