开发者

MacOs software CRON-like

开发者 https://www.devze.com 2023-03-13 22:46 出处:网络
I wrote scripts which permit to synchronise some of my local folders with a backup on a remote server (using ssh). In fact, these scripts permit to have an incremental save done.

I wrote scripts which permit to synchronise some of my local folders with a backup on a remote server (using ssh). In fact, these scripts permit to have an incremental save done. In order to have a RPO less than 1 hour I have to play this script every hour.

Do you know an easy to use tool/software permitting to automate this (lauched at boot, running l开发者_如何转开发ike a daemon) ?

thanks again for your help


On OS X launchd is handling all such things.

Lingon helps writing launchd plists.


You could use cron, or the preferred launchd


You said it yourself: cron. Cron runs happily in the terminal (Applications->Utilities->Terminal), and in Terminal you can do a "man cron" for details.

For what you want to do, it seems you just need a cron entry that looks like:

0 * * * * synchronize-script-name.sh

where synchronize-script-name.sh is the name of your script, and this will run it on the hour.

The crontab command lets you edit the crontab for any user (assuming you have su privilege, otherwise you can only edit your own)


On startup? Or on login? On login - MacOSx launch application on system start

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号