-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate snapshot schedule using Cron & CLI
- Loading branch information
1 parent
c5ca47a
commit f468b47
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Automate NFS snapshot creation using Cron | ||
Cron is a flexible and powerful utility that can reduce the burden of many tasks associated with system administration. When combined with shell scripts, you can automate tasks that are normally tedious or complicated. | ||
|
||
Snapshots can be triggered on NFS file shares in hourly, daily, weekly and monthly schedules | ||
|
||
crontab is a special file that holds the schedule of jobs cron will run. This allows you to edit your user profile’s crontab without changing your privileges with sudo. | ||
|
||
You can edit your crontab with the following command: | ||
crontab -e | ||
|
||
tasks scheduled in a crontab are structured like the following: | ||
Minute hour day_of_month month day_of_week command_to_run | ||
|
||
For Example | ||
#if you want to run Snapshots every 15 mins , here is the command | ||
*/15 * * * * az storage share snapshot --name <File share name> --account-name <Storage account name> | ||
|
||
#if you want to run Snapshots hourly , here is the command | ||
* */1 * * * az storage share snapshot --name <File share name> --account-name <Storage account name> | ||
|
||
#if you want to run Snapshots daily at 9PM, here is the command | ||
0 21 * * * az storage share snapshot --name <File share name> --account-name <Storage account name> | ||
|
||
#if you want to run Snapshots Weekly at 9PM, here is the command | ||
0 21 * * 5 az storage share snapshot --name <File share name> --account-name <Storage account name> | ||
|
||
#if you want to run Snapshots Monthly , last day of the month at 9PM, here is the command | ||
0 21 30 1-12 * az storage share snapshot --name <File share name> --account-name <Storage account name> | ||
|