Case Study Lab VI: Backup and shave web folders

Task Overview
Description of the task

We want to back up the entire contents of the directory /www every day. We want to have some backup. However, we do not want the backup folder amassed new files.

Write a function ShaveFolder, which retains any folder n recent files. The function will be configurable. The first parameter is the folder where we want to perform shave. The second parameter is the number of recent files that remain in the folder.

Write a script backup-web.sh, that:

  • creates a new backup site
  • includes the function ShaveFolder
  • uses of ShaveFolder to shave folder. We want to keep the last 90 backups