1 Backup workshop Stanford Exploration Project Two procedures 2 Two procedures 3 Two procedures 4 rsync amp crontab Two procedures 5 rsync amp crontab Two procedures 6 rsync ID: 911824
Download Presentation The PPT/PDF document "Yi Shen Mar 18 th , 2014" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Yi ShenMar 18th, 2014
1
Backup workshop
Stanford Exploration Project
Slide2Two procedures2
Slide3Two procedures3
Slide4Two procedures4
rsync
&
crontab
Slide5Two procedures5
rsync
&
crontab
Slide6Two procedures6
rsync
&
crontab
Time machine
Slide7The first procedure7
rsync
&
crontab
Time machine
Slide8Introduction of rsync8Synchronize your files and directories from the server to your local computer;Only back up the changes
Slide9Introduction of crontab9Allows tasks to automatically run in the background of the system at given intervals;Helps you do the backup once a day without manual operation.
Slide10Procedure10Make a directory in your mac for backupCopy the script to your backup directory
Change the scriptManually run the scriptCreate a
cron scheduleCheck the success of your crontab
Slide11Procedure11Make a directory in your mac for backup e.g. mkdir
~/backupCreate a file on the server for monitor
e.g mkdir ~/backup/Create a txt file like “I am doing backup”
Slide12Procedure12Make a directory in your mac for backupCopy
rsync
script to your backup directoryChange the scriptManually run the scriptCreate a cron schedule
Check the success of your crontab
Slide13Procedure13Download it fromhttp://sepwww.stanford.edu/data/media/public/sep/yishen/backup/
Procedure14Make a directory in your mac for backupCopy the
rsync script to your backup directory
Change the scriptManually run the scriptCreate a cron scheduleCheck the success of your
crontab
Slide1515
Slide1616
Slide1717
Slide1818
Slide19Procedure19Make a directory in your mac for backupCopy the script to your backup directory
Change the scriptManually run the script
Create a cron scheduleCheck the success of your crontab
Slide20Manually test20./backupscript.pyThe first backup will take a while Manually running the script for your first backup during the
weekend or in the evening instead of using
crontab is recommended.
Slide21Procedure21Make a directory in your mac for backupCopy the script to your backup directory
Change the scriptManually run the script
Create a cron scheduleCheck the success of your crontab
Slide22Create a cron schedule22Type “crontab –e” in the terminal window
The text editor will open a blank window for the “crontab entries” to be entered.
Each line presents a separate cron jobs.
Slide23Create a cron schedule23* * * * * /Users/yishen/backup/backupscript.py restart
Slide24Create a cron schedule24* * * * * /Users/yishen/backup/backupscript.py restart
Slide25Create a cron schedule25* * * * * /Users/yishen/backup/backupscript.py restart
Slide26Create a cron schedule26An asterisk (*) is used to indicate that every instance of the particular time period will be used. * * * * *
Slide27Create a cron schedule27An asterisk (*) is used to indicate that every of the particular time period will be used. * * * * *
Minute 0-59
Slide28Create a cron schedule28An asterisk (*) is used to indicate that every of the particular time period will be used. * * * * *
Hour 0-23 (0 = midnight)
Slide29Create a cron schedule29An asterisk (*) is used to indicate that every of the particular time period will be used. * * * * *
Day 1-31
Slide30Create a cron schedule30An asterisk (*) is used to indicate that every of the particular time period will be used. * * * * *
Month 1-12
Slide31Create a cron schedule31An asterisk (*) is used to indicate that every of the particular time period will be used. * * * * *
Weekday 0-6
Slide32Change asterisks(*) accordingly 32
Slide33Change asterisks(*) accordingly 33
Slide34Change asterisks(*) accordingly 34 For example, Yi Shen’s command would look:
40 1 * * * /Users/yishen/backup/backupscript.py restart
Slide35Procedure35Make a directory in your mac for backupCopy the script to your backup directory
Change the scriptManually run the script
Create a cron scheduleCheck the success of your crontab
Slide36Check36Type “ls -ltr /var/mail”Check the time shown in bold as follows
-rw------- 1 yishen
mail 5559 Mar 16 1:40 yishen
Slide37Check37Type “ls -ltr /var/mail”Check the time shown in bold as follows
-rw------- 1 yishen
mail 5559 Mar 16 1:40 yishen
Slide38Check (2)38Growl
Slide39Notice39The first backup will take a while Manually running the script for your first backup during the weekend or in the evening instead of using
crontab is recommended.
Slide40The second procedure40
rsync
&
crontab
Time machine
Slide41Procudures41Initialize your hard drive Use time machine to back up your local computer
Slide42Initialize your hard drive42
Slide4343
Slide44Procudures44Initialize your hard drive Use time machine to back up your local computer
Slide45Introduction of time machine 45The built-in backup that works with your Mac and an external drive;Automatically backs up your entire Mac;Remembers how your system looked on any given day;
Performs subsequent hourly backups of only the files that have changed on your Mac since the last backup
Slide46Change the backup interval 46From the command linePoint-and-click
Slide47Change the backup interval 47sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -
int 18000
Slide48Change the backup interval 48sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -
int 18000
backup interval in seconds — five hours
Slide49Change the backup interval 49From the command linePoint-and-click
Time machine scheduler
Slide50Notice50The first backup may take a while;Set up Time Machine in the evening so that the initial backup can be done overnight.
Slide51Acknowledgement51Thanks Sjoerd for helping with the rsync script
Thanks Bob for purchasing the cases
Thanks Ohad for providing the internal hard drives
Slide52Yi ShenMar 18th, 2014
52
Thank you
Stanford Exploration Project