If you want to start the operation, you can use the Mac's own Automator will run the command package into an app, and then in the user group "start at Login" list plus that app.
But you can't do that if you want to run it on a regular basis, using a command called crontab (or software?). )
The practical instructions are only 3, very brief.
Edit a Scheduled Task list
Crontab-e
Show all Scheduled Tasks list
Crontab-l
Delete all Scheduled Tasks list
Crontab-r
And you can get through
crontab [file]
To put the configuration file in any location to crontab. As long as your files are legitimate text.
Like what
Crontab ~/autoscripts/.crontab
The exact configuration file format is also simple
Each row has 6 elements, the first 5 elements are time, and the order represents
Minute Hour month date week
Can be a number representing only that number, or "0-10" to indicate a period of time, or an asterisk (*) to indicate any time
Like what
* * * * * * Say hello
The delegate runs say hello at any time (i.e. every minute) on the console, that is, read out Hello
5 1 say fuckyou
It's a 5-point computer yelling "fuck♂you" every Monday morning.
6th element visible is the command to execute
Mac/linux timed Run command line