teamcity cronjob management

Hello. I am looking for solution how can I manage cronjobs on multiple servers via teamcity. Any ideas are welcome.

0
5 comments
Hi Yovcho,

Can you provide more details on what exactly you want to achieve? What is the desired scenario?

Best regards,
Anton
0

Hello Anton Vakhtel Thank you for your fast reply.

We have multiple servers wih crontabs, where are installed many cronjobs. I try to find solutions how can I manage this cronjobs.  For now everything is manualy - 1. login via ssh on the server, edit crontab, add/remove/update the cronjob and save it.

I am looking for some solutions to do this via teamcity over ssh commands or some plugin for this.

Any ideas are welcome.

Have a great day.

 

0
Dear Yovcho,

You can use the SSH Exec build step in TeamCity to execute arbitrary remote commands using SSH: https://www.jetbrains.com/help/teamcity/2024.03/ssh-exec.html.
Please let me know if this answers your question.

Best regards,
Anton
0

Hello, Anton Vakhtel . Many thanks for your reply again. 

SSH exec build step I will use to deploy the cronjobs. But I have few steps before this - how can I create a list with all cronjobs, who will deployed on the servers with arguments/parameters/etc.  There are already have some meta-runer example for creating file template with crons etc?

Best wishes.

 

 

0
Dear Yovcho,

No, there is no specific build runner/plugin for managing cronjobs, but you should be able to do this with the Command Line runner using the command-line script. Alternatively, the Python script may be more convenient, and you can use the Python runner for this.
Or, if your use case is to create/change cronjobs files manually, and you need TeamCity to deploy it automatically for you, you can just store your files in VCS, add a build configuration that will monitor your VCS root and deploy the files in the SSH build step, and every time you will commit changes to the files, it will run the deployment step.

Best regards,
Anton
0

Please sign in to leave a comment.