life00 / awecron.sh

small and simple cron that is the best option for desktop users
MIT License
3 stars 3 forks source link

Timestamp calculation #6

Closed kurahaupo closed 2 years ago

kurahaupo commented 2 years ago

This line

                time=$(date +%s%N | cut -b1-10)

includes nanoseconds and then cuts them off again. A simpler version would be

    time=$( date +%s )

However even that is unnecessary.

    printf -v time '%(%s)T'

Also I adjust the main loop so that it runs 60 seconds after the previous run started rather than 60 seconds after it finished, or immediately if the job took longer than 60 seconds to run.

life00 commented 2 years ago

yeah, my code here is kind of dumb. i will fix it, thanks. also i dont see any issues with the order how cron runs. it was mainly done so for feedback without waiting while testing. tell me if i am missing something about the order