Question

The course is server management and I am using FREEBSD Create a folder off the root...

The course is server management and I am using FREEBSD

  1. Create a folder off the root that can be used for the backed-up files. You will need to use root to create this directory. Set the user and group for this directory to the account that you normally log in to.
  2. Create a cron process that will run every thirty minutes and copy the complete contents, including directories and their contents, to the backup location.
  3. The copy command should use the verbose option, and direct its output to a log file stored in the backup directory.

I have already done parts 1 and 2

I created a directory called Backedupfiles

The user I have is 'admin1'

/usr/home/admin1

I tried 'crontab -e' and it was really confusing, wouldnt let me type some things and I couldnt figure out how to exit it.

I just need help with Question 3

Homework Answers

Answer #1

I do not have FreeBSD to use, but I have done a similar thing on my Lubuntu machine, and to be honest, cron works almost the same on all Linux machines.

You also need to create a log file to direct the output of copy commands to it as per the requirement. You can name it anything you want(I kept it as cronLogFIle)
When you are doing crontab -e, the only possible reason why you are not able to type in some things could be that your default editor is not the one you generally use.

For example, when I did crontab -e, it shows 4 editors, and lets me choose one of them, I chose vim.basic because that's what I prefer to edit any file with.

If you wish to change the default-editor, run select-editor command and pick one for yourself. Then do crontab -e and just add one line and save the file. You are done.

This is what you need to append in your crontab file:

*/30 * * * * cp -rv /usr/home/admin1/ Backedupfiles/ >> cronLogFile

This is how your crontab -e will look like:

/30 is for running the script every 30 minutes
-r flag is for recursively copying everything into the Backedupfiles folder.
-v flag is for doing it verbose.
>> command appends the logs to the cronLogFile

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions