Cronjob as alternative to service
proffapt opened this issue · 5 comments
proffapt commented
Implement mftp as a cronjob
along with a continuously running service in infinite loop.
Basic idea
mftp cronjob disable
mftp cronjob enable
mftp cronjob enable 30
Why this? and Why not only this?
Cronjob will be best for:
- Internal Servers.. not requiring OTP for login
- Small devices like rpis.. limited in resources
Service will be best for:
- External Servers.. requiring OTP for login
- Having enough resources
proffapt commented
Great, then let me know if you need some kind of help
lakshz commented
@proffapt , needed some clarity on this. This is what I've understood:
Currently, the mftp.py
script runs on an infinite loop and continuously monitors the CDC noticeboard. For cronjob, instead of an infinite loop, I just need to send new notices after a scheduled time. So, I'll remove that infinite loop in a new script and add a bash script to create a crontab
.
Is this flow correct, on high level?
proffapt commented
mftp-as-a-service.sh
- Will have those cronjob comamnds:
mftp cronjob enable..
- Another file will be created without infinite loop
- That file will be added into cronjob, there will be default time of 2 mins if the user doesn't provide
lakshz commented
got it thanks :)