How it work:
Thanks for the random quotes which generate by the zenquotes API.
https://telegram.me/BotFather
GOOS=linux GOARCH=amd64 go build <your parth of project>/cronJobProject/cronjob.go
scp cronjob root@your_ipaddress:/usr/local/src/telegram-bot/
vi /etc/systemd/system/telegram_bot.service
then add code:
[Unit]
Description=Telegram-bot service
After=multi-user.target
[Service]
User=root
Group=root
Type=simple
Restart=always
RestartSec=5s
ExecStart=/usr/local/src/telegram-bot/cronjob
[Install]
WantedBy=multi-user.target
sudo systemctl start telegram_bot.service
sudo systemctl enable telegram_bot.service
sudo systemctl status telegram_bot.service
This project is licensed under the MIT license. You're free to use it.