The course is server management and I am using FREEBSD
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
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
Get Answers For Free
Most questions answered within 1 hours.