python script as centos service

Task completed!py_vk

I made a vkontakte Bot which delete all comments are not from group members!

But I do not want to run it by cron, because it will SPAM all my system with cron emails.

But I found resolution:

  • make a worker.py
  • allow worker to run delete scripts on time periods
  • add worker as centos service
  • have fun!

Maybe later I’ll add more code, but now just for example I’ll show only worker and bash script:

And bash to run this as service:

Log:

vk_comments_del

Log

and process:

vk_comments_del_ps

process

 

Based on:

Run python as service: https://wolfpaulus.com/journal/software/pythonlauncher/

Schedule python: https://github.com/dbader/schedule

Python 100% CPU: http://raspberrypi.stackexchange.com/questions/8077/how-can-i-lower-the-usage-of-cpu-for-this-python-program/8078

 

trianglesis

About trianglesis

Александр Брюндтзвельт - гений, филантроп, 100 гривен в кармане. Этот блог - "сток" моих мыслей и заметок. Достаточно одного взгляда на него, чтобы понять, что такой же бардак творится у меня в голове. Если вам этот бардак интересен - милости прошу.
Bookmark the permalink.