LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-21-2010, 04:00 AM   #1
aiushtha
LQ Newbie
 
Registered: Jul 2010
Posts: 11

Rep: Reputation: 3
Question "I Need Simple Backup SH Script"


Hi friends, search backup sh script thread in programming, but I cant find as I want.Please help me.

I want to simple script.

1-.tar selected folder (/ , /home etc.)
2-copy network drive (samba or nfs)
3-Send succes or fail mail.


Thanks in advance.

PS:for Redhat.
 
Old 07-21-2010, 04:11 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Welcome to LQ
Did you tried google?
http://thewaystation.com/techref/unix/backups.shtml
http://www.google.be/search?hl=en&cl...=&oq=&gs_rfai=
 
1 members found this post helpful.
Old 07-21-2010, 05:49 AM   #3
aiushtha
LQ Newbie
 
Registered: Jul 2010
Posts: 11

Original Poster
Rep: Reputation: 3
Question

Quote:
Originally Posted by repo View Post
repo thanks for reply and links.

But I need example script for only in 1-2-3.Do you help me?
 
Old 07-21-2010, 05:57 AM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Example scripts which do each of the 3 items you indicate, should be plentiful around the internet, and surely there are some examples right here on LQ, just a SEARCH away.. If you find some and edit them to suit your exact situation, or write your own, and it does not work as expected, please show us the scripts and paste verbatim any errors produced and/or describe the problem in detail, and we will try to help you fix the problems. Probably not many people are willing to write you your scripts, or do your searching for you.

Cheers!
 
1 members found this post helpful.
Old 07-21-2010, 08:08 AM   #5
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
At its simplest, a script is just a sequence of shell commands entered in a file. Give the file execute permissions and take off.

So, get the syntax for your tar commands, your copy commands, an email command, and put them in file. Test each by hand first. That makes your script.

If you put the script in cron, and it generates errors, you automatically get those by email. So, you might not even need the email part.

Ask questions on details if necessary.

All part of learning Linux.
 
1 members found this post helpful.
Old 07-21-2010, 10:19 AM   #6
aiushtha
LQ Newbie
 
Registered: Jul 2010
Posts: 11

Original Poster
Rep: Reputation: 3
Exclamation

Hi again,

I was modified this bash script.It's perfect works.But I don't know, how to send mail when finished?I'm using qmail.( mail to: ?, mail -s ? or ?)
 
Old 07-21-2010, 10:45 AM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
Originally Posted by aiushtha View Post
Hi again,

I was modified this bash script.It's perfect works.But I don't know, how to send mail when finished?I'm using qmail.( mail to: ?, mail -s ? or ?)
http://www.simplehelp.net/2008/12/01...-command-line/
 
1 members found this post helpful.
Old 07-22-2010, 02:32 AM   #8
aiushtha
LQ Newbie
 
Registered: Jul 2010
Posts: 11

Original Poster
Rep: Reputation: 3
hmm, mail -s command does not works to qmail..

I was created mail.sh and I wrote the following;
------------------------
telnet localhost 25
ehlo
mail from:a@host.com
rcpt to:b@client.com
data
backup success
.
quit
-------------------------

this is nice idea


but now problem is data integrity..! How do we do ?
 
Old 07-25-2010, 03:38 PM   #9
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by aiushtha
hmm, mail -s command does not works to qmail..
You may need to create symlinks to help out mailx(1).

Read section 2.8.3 of the Life with qmail guide.
 
1 members found this post helpful.
Old 07-27-2010, 06:01 AM   #10
aiushtha
LQ Newbie
 
Registered: Jul 2010
Posts: 11

Original Poster
Rep: Reputation: 3
Smile

anomie, thanks for reply.

I was read life with qmail 1 weeks ago, but I can't find anything..

By the way, I solved the problem by installing Acronis.
 
  


Reply

Tags
backup, linux, script, sh, simple



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 Using tar - Error "file changed as we read it" 3rods Linux - Software 6 03-08-2014 05:18 AM
How to write a simple BASH script to "test if have folowing files, than delete."? hocheetiong Programming 10 10-01-2009 12:17 PM
Simple "Email Alert" Script/Solution zok Linux - Networking 7 07-09-2008 01:13 PM
Simple bash script "unexpected end of line error" snowman81 Programming 11 11-11-2007 09:31 AM
Simple "service" script for dealing with rc files arobinson74 Slackware 0 09-06-2004 11:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:53 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
Open Source Consulting | Domain Registration