Practice
1, every Monday to Saturday 3:20 A.M., run the CP command to save the/etc/directory, storage location
For/BACKUPS/ETC-YYYY-MM-DD;
3 * * 1-6/bin/cp-a/etc/tmp/etc-' Date +\%f '
2, every Sunday 2:30 A.M., run the CP command to backup the/etc/fstab file, the storage location is/backup/fstab-
Yyyy-mm-dd-hh-mm-ss
2 * * 7/bin/cp-a/etc/fstab/backup/fstab-' date +\%f-\%h-\%m-\%s '
3, every night 12 o'clock, get all the lines in the/proc/meminfo file starting with S or M, append
To the/statistics/meminfo.txt file, and before the daily message, add a similar =============== separator line;
* * * * * */bin/echo "================" >>/statistics/meminfo.txt &&/bin/egrep "^ (s|
M) "/proc/meminfo >>/statistics/meminfo.txt
This article is from the "naïve Little Comrade" blog, please be sure to keep this source http://dengxi.blog.51cto.com/4804263/1692042
Linux Learning Path 6-exercises and assignments