#!/bin/bash # Copyright (C) 2009 Przemyslaw Pawelczyk # This script is licensed under the terms of the MIT license. Here is a sample /root/bin/replication.sh file: * * * * * root /usr/bin/perl /usr/lib/cgi-bin/ # Another example to set up cron job every 1 minute is a commonly used in cron schedule. Create a file named /etc/crond.d/rsync.job If you put cronjob in /etc/cron.d/ directory you must provide the username to run the task as in the task definition:įor example, run a script that uses rsync to replicate changed files. A note about using /etc/cron.d/ directory An asterisk in the every field means run given command/script every minute. For example, an asterisk in the hour time field would be equivalent to every hour or an asterisk in the month field would be equivalent to every month. The asterisk (*) operator specifies all possible values for a field. To run a script called /home/vivek/bin/foo, type the crontab command: MacOS users: First, install Homebrew on macOS and then type the following brew command:īrew install flock Run cron job every minute
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |