Replies: 7 comments 20 replies
-
Hi, Glad you like it :) For cron jobs will something like this work for you: processes:
cleaner:
command: "find ./ -type f -mtime +7 -name '*.bak' -execdir rm -- '{}' \\;"
working_dir: "/somedir"
availability:
restart: "always"
backoff_seconds: 604800 # every 7 days Or you are looking for something that follows closer the cron syntax? |
Beta Was this translation helpful? Give feedback.
-
Hey @rupurt, @thenonameguy, This became a significant refactoring effort and took much longer than expected. |
Beta Was this translation helpful? Give feedback.
-
I need cron job. I do not want to code it into my app and run it all the time. I could have run some cron app script all the time, and it will launch my app. So that would not be so easy to see in PC TUI. In systemd I have timers https://akashrajpurohit.com/blog/systemd-timers-vs-cron-jobs/ And I have most degen way - bash with sleep loop for simple case. Will do this. So systemd like timers feels interesting. |
Beta Was this translation helpful? Give feedback.
-
So Replica sets are complicated. In K8S they just work because of full isolation of containers (none in PC). What rules will be for isolation of processes in PC scaled up? Another issues, K8S has RS because it also have autoscalers, so actually final features is metric based autoscaler. It pretty fills overkill and will never be target of PC. Right? Another point, may you just cp yaml block in muliline editor and make clones and restart. I assume PC is not tool to run server side processes for long (serviced/k8s are). So workaround is easy - make yaml. |
Beta Was this translation helpful? Give feedback.
-
So why make YAML is good for scale but not cron ? Visibility in UI. If code bash cron wrapper cannot see in TUI nice view of CRON invocations. So simplicity and speed of rebuild/restart to is what is killer feature of PC, CRON integration for sure adds to that agenda. |
Beta Was this translation helpful? Give feedback.
-
For periodic(not cron) can use simple wrap comand like As for scale, I guess before scale, it can be found out that in K8S first goes hot reload of config, so it may be that PC to think of how and why hot reload before scale. K8S has controllers to define dependencies of reload. So what would be rule to reload when upscale or downscale happens? |
Beta Was this translation helpful? Give feedback.
-
As a temporary workaround for cron jobs you can consider something like: processes:
job:
command: echo Hi
availability:
restart: "always"
backoff_seconds: 604800 # will run once a week |
Beta Was this translation helpful? Give feedback.
-
Howdy 👋,
Love the project. Do you have any plans to support ephemeral processes for things like batch or cron jobs?
Beta Was this translation helpful? Give feedback.
All reactions