You are on page 1of 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