[Feature request] Automated Conversion triggered only within specified time range
Idea
Hello,
I would like to suggest to implement a way to specify time slot for automated conversions. I would desire it to be triggered only during night hours when I am not using the server for other activities..
Haven't seen this in documentation so I expect it is not possible at the moment.. Please let me know if it is something you can implement in your image.
Should be possible via CRON. I would like to see multiple CRON slots so it can be combined in a more precise way:
- Monday-Friday from midnight until 4pm:
0 0-16 * * MON-FRI - Saturday-Sunday from 2am until 10am:
0 2-10 * * SAT-SUN
Having such environment variable:
AUTOMATED_CONVERSION_TIMEFRAME: ['0 0-16 * * MON-FRI', '0 2-10 * * SAT-SUN']
Then implement just ifcheck if the current time is within given CRON range.
Appreciate, Michal
Although such feature seems to be not implemented, as a workaround, you can take advantage of a pre-conversion hook (docs), that will pause the execution of the conversion as long as a certain condition is met.
An example pre-conversion hook could look like this:
#!/bin/sh
# ...
current_time="$(date +'%s')"
min_time="$(date -d '14:00' +'%s')"
while [ "$current_time" -lt "$min_time" ]; do
echo "pre-conversion: Conversion is paused until 14:00"
sleep 60
current_time="$(date +'%s')"
done
(Make sure your timezone is set correctly within the container.)
Of course, you will have to implement your own pause condition logic depending on your needs.
:OOOOOOO
Am I having a Fairy Godmother or something??