Hi guys .
Im joseph , im from chile and this is my firs time with linux scripts .
i need some tips to finish my script for my college .
------------------
Make an backup script.
1)- Copy files incrementally -of way from a source directory to a destination directory ( create variables to store locations) . LONG AS the destination directory exists.
Code:
R: rsync -ab /home/OriginFile /home/DestinyFile
2) - Document all messages in a log whose name meets the format " date - bkp.log " (eg - bkp.log 20,150,606 ) .
Code:
R : rsync -ab /home/OriginFile /home/DestinyFile >>/var/log/mytest.log 2>/dev/null
3) - Compare the source files and targets using md5sum . Only if they are equal ( the back bone was performed correctly) delete all files in the source directory that are greater than a date ( the date should be stored in a variable).
Code:
R : i dont have an idea . :(
4) - After completing the process , the log must be sent by mail to the manager or managers ( store information in a variable).
R:
Code:
#To : " To
• read -p " #Texto : " Text
• read -p " #Asunto : " Subject
•
• echo " ######## To send attached specify the /ruta/log.txt ######## "
• echo " ######## Otherwise leave the field empty and press enter ######## "
• echo -n " deputy Route "
•
• read Route
•
• ##
•
• while true; do
• read -p " and want to send attachment or n : " n
• case $ n in
• [ Yy ] *) echo $ text | Subject mutt -s $ $ $ To -a path ; echo " Sending mail Attachment" ; exit ;;
• [ Nn ] *) echo $ text | mail -s $ To $ Subject ; echo " Sending mail" ; exit ;;
• *) echo " Selection and o n , it is necessary " ;;
• esac
• done-
--------------------
i really apreciate your help because i want to be good programming in linux and with good teachers and help y can make it .
thanks all .