Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-26-2015, 08:20 AM   #1
LQ Newbie
Registered: Jun 2015
Posts: 2

Rep: Reputation: Disabled
Problem with file backup script

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.

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 ) .
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).
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).
#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 " ;;

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 .

Last edited by Fantaria; 06-26-2015 at 09:39 AM.
Old 06-26-2015, 11:41 AM   #2
LQ Guru
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,673

Rep: Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855
is this the real code you tried to execute, or it was somehow modified? There should be no space between $ and variable name, so this will definitely not able to run.
Old 06-26-2015, 12:07 PM   #3
LQ Newbie
Registered: Jun 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
im not sure because these came from a page in spanish .

well , im sure about the failure , but i am trying to make this exercise .


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup script creating zero bytes file ikrpulla Linux - General 1 06-04-2015 08:27 AM
mysql full backup script not archiving the dump file seccentral Linux - Software 2 03-20-2011 07:29 AM
script to upload backup file to smb share c_mitulescu Linux - Networking 1 03-15-2007 11:34 AM
Need a script for daily backup of oracle archive file sathyguy Linux - Newbie 15 01-22-2007 06:49 AM
Backup script to write to file? ctroyp Linux - Newbie 13 01-10-2006 06:15 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration