LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-26-2015, 09:20 AM   #1
Fantaria
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.

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 .

Last edited by Fantaria; 06-26-2015 at 10:39 AM.
 
Old 06-26-2015, 12:41 PM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,120

Rep: Reputation: 2269Reputation: 2269Reputation: 2269Reputation: 2269Reputation: 2269Reputation: 2269Reputation: 2269Reputation: 2269Reputation: 2269Reputation: 2269Reputation: 2269
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, 01:07 PM   #3
Fantaria
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 .
 
  


Reply


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 09:27 AM
mysql full backup script not archiving the dump file seccentral Linux - Software 2 03-20-2011 08:29 AM
script to upload backup file to smb share c_mitulescu Linux - Networking 1 03-15-2007 12:34 PM
Need a script for daily backup of oracle archive file sathyguy Linux - Newbie 15 01-22-2007 07:49 AM
Backup script to write to file? ctroyp Linux - Newbie 13 01-10-2006 07:15 PM


All times are GMT -5. The time now is 06:47 AM.

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