0% found this document useful (0 votes)
107 views1 page

3rd Set of Tasks

The document provides instructions for tasks related to Linux servers, including checking hard disk information using smartctl, identifying the package that smartctl comes from, creating a backup script to backup important configuration files daily using cron, and creating a secondary script to delete backups older than two months. It notes to always backup working configurations before making modifications and provides an example of backing up a file with a timestamp in the filename for versioning. The tasks also include listing existing cron jobs and adding the new backup and deletion scripts to cron.

Uploaded by

Charlygrafitero
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views1 page

3rd Set of Tasks

The document provides instructions for tasks related to Linux servers, including checking hard disk information using smartctl, identifying the package that smartctl comes from, creating a backup script to backup important configuration files daily using cron, and creating a secondary script to delete backups older than two months. It notes to always backup working configurations before making modifications and provides an example of backing up a file with a timestamp in the filename for versioning. The tasks also include listing existing cron jobs and adding the new backup and deletion scripts to cron.

Uploaded by

Charlygrafitero
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

3rd set of taks

Linux Servers

Ricardo Cabete

1. Try to check your harddisks Power_On_Minutes and Power_Cycle_Count with smartctl. Why are these values not shown in your system? $ apt-get install smartmontools $ smartctl --all /dev/sda [The command fail our HD is a virtual one] 2. From which software package did smartctl come from? You can check that with apt-cache, rpm or yum $ apt-cache search smartctl [comes from smartmontools] [rpm and yum will not run on Debian Linux] 3. Create a simple backup script that uses tar to create backups from important configuration files and executes daily backups by using cron. You can look examples from http://www.scrounge.org/linux/cron.html NOTE: Always backup your WORKING configurations before doing any modifications! A good way to do it is by using cp. Example: $ cp apache.conf apache.conf.tero20091004 [copy file with backup creator's name and date stamp] [Create you bash script] # crontab l [lists jobs for current user] [Create a .txt file with any name and list the script you want to add to cron. In this case we assume jobs.cron] $ crontab jobs.cron 4. Also create secondary script that deletes backups older than two months. [Create your bash script] [Add your script to file jobs.cron] $ crontab jobs.cron

You might also like