Unix Technical Forum

script to take backup

This is a discussion on script to take backup within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hello all, i want to create a script to take backup of specific directories. eg: abc, xyz and bcd ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-04-2008, 06:56 PM
suhailh@yahoo.com
 
Posts: n/a
Default script to take backup

Hello all,

i want to create a script to take backup of specific directories.

eg: abc, xyz and bcd directories in root directory

cd /
find . -name <....> |backup -ivqf /dev/rmt0

how can i list only abc, xyz and bcd directories in the search.

Thanks in advance.

hope i'm clear.

Regards,
Suhail
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-04-2008, 06:56 PM
Dirk Gently
 
Posts: n/a
Default Re: script to take backup

<suhailh@yahoo.com> wrote in message
news:bde918fd.0307260617.7adc61a0@posting.google.c om...
> Hello all,
>
> i want to create a script to take backup of specific directories.
>
> eg: abc, xyz and bcd directories in root directory
>
> cd /
> find . -name <....> |backup -ivqf /dev/rmt0
>
> how can i list only abc, xyz and bcd directories in the search.
>
> Thanks in advance.
>
> hope i'm clear.
>
> Regards,
> Suhail


You can do multiple find command into a file that you will use as your list.

find /abc -name X >backuplist
find /xyz -name X >>backuplist
find /bcd -name X >>backuplist
backup -ivqf /dev/rmt0 <backuplist

Or something like that.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-04-2008, 06:56 PM
Uli Link
 
Posts: n/a
Default Re: script to take backup

> > i want to create a script to take backup of specific directories.
> >
> > eg: abc, xyz and bcd directories in root directory
> >
> > cd /
> > find . -name <....> |backup -ivqf /dev/rmt0
> >
> > how can i list only abc, xyz and bcd directories in the search.
> >

>
> You can do multiple find command into a file that you will use as your

list.
>
> find /abc -name X >backuplist
> find /xyz -name X >>backuplist
> find /bcd -name X >>backuplist
> backup -ivqf /dev/rmt0 <backuplist
>
> Or something like that.
>
>

this is the holistic way.
I recommend using separate backups. So if you will ever need a selective
restore you can simply skip the unwanted dirs and save a lot of time. To
make it even better you can backup the backuplist(s) as the first backup on
you tape.
But better use the norewind device instead.

I recommend cpio over the backup command, cause you can restore a cpio on
really every machine in the universe. Not a matter in a true blue shop.

---
Uli (BOFH: linked tape device to /dev/null, never got a faster backup...)




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-04-2008, 06:56 PM
Dirk Gently
 
Posts: n/a
Default Re: script to take backup

"Uli Link" <Ulrich--nO--(dot)-sPAM--Link@Epost.de> wrote in message
news:bfuk5r$iik$03$1@news.t-online.com...
>
>
> this is the holistic way.


Hence my name!

;-)


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-04-2008, 06:56 PM
Steve Nottingham
 
Posts: n/a
Default Re: script to take backup

"Dirk Gently" <holitisc@detective.agency> wrote in message news:<CowUa.12687$Wh.1266139@news20.bellglobal.com >...
> <suhailh@yahoo.com> wrote in message
> news:bde918fd.0307260617.7adc61a0@posting.google.c om...
> > Hello all,
> >
> > i want to create a script to take backup of specific directories.
> >
> > eg: abc, xyz and bcd directories in root directory
> >
> > cd /
> > find . -name <....> |backup -ivqf /dev/rmt0
> >
> > how can i list only abc, xyz and bcd directories in the search.
> >
> > Thanks in advance.
> >
> > hope i'm clear.
> >
> > Regards,
> > Suhail

>
> You can do multiple find command into a file that you will use as your list.
>
> find /abc -name X >backuplist
> find /xyz -name X >>backuplist
> find /bcd -name X >>backuplist
> backup -ivqf /dev/rmt0 <backuplist
>
> Or something like that.


What's wrong with:

find /var /tmp /home | backup -ivqf /backupdir/filename

?

Works here.

Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-04-2008, 06:56 PM
Dirk Gently
 
Posts: n/a
Default Re: script to take backup

"Steve Nottingham" <steve@wakefieldrfc.freeserve.co.uk> wrote in message
news:42862645.0307261238.7a0db71c@posting.google.c om...
> "Dirk Gently" <holitisc@detective.agency> wrote in message

news:<CowUa.12687$Wh.1266139@news20.bellglobal.com >...
> > <suhailh@yahoo.com> wrote in message
> > news:bde918fd.0307260617.7adc61a0@posting.google.c om...
> > > Hello all,
> > >
> > > i want to create a script to take backup of specific directories.
> > >
> > > eg: abc, xyz and bcd directories in root directory
> > >
> > > cd /
> > > find . -name <....> |backup -ivqf /dev/rmt0
> > >
> > > how can i list only abc, xyz and bcd directories in the search.
> > >
> > > Thanks in advance.
> > >
> > > hope i'm clear.
> > >
> > > Regards,
> > > Suhail

> >
> > You can do multiple find command into a file that you will use as your

list.
> >
> > find /abc -name X >backuplist
> > find /xyz -name X >>backuplist
> > find /bcd -name X >>backuplist
> > backup -ivqf /dev/rmt0 <backuplist
> >
> > Or something like that.

>
> What's wrong with:
>
> find /var /tmp /home | backup -ivqf /backupdir/filename
>


I've been doing shell scripts for years, and I learn something every day!
Cool!


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-04-2008, 07:03 PM
suhailh@yahoo.com
 
Posts: n/a
Default Re: script to take backup

find /var /tmp /home | backup -ivqf /backupdir/filename

i tried this but doesn't work with me, i'm running AIX 5.1?

anyway i did it with tar.

thanks for all your time, i will still try to find an option to use backup.

if anyone has other ideas, please send it.

Regards,



"Uli Link" <Ulrich--nO--(dot)-sPAM--Link@Epost.de> wrote in message news:<bfuvn4$ji0$04$1@news.t-online.com>...
> > > >
> > > > i want to create a script to take backup of specific directories.
> > > >
> > > > eg: abc, xyz and bcd directories in root directory
> > > >

> >
> > What's wrong with:
> >
> > find /var /tmp /home | backup -ivqf /backupdir/filename
> >

>
> Wow!
> checked find syntax on Solaris 2.6, works there too even with the
> omitted -print!
> Seems to be portable too, surprise, surprise!
>
> better use relative paths for backup. Easier to restore to a different
> location than stripping the leading slash afterwards.
>
> ---
> Uli

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-04-2008, 07:03 PM
Steve Nottingham
 
Posts: n/a
Default Re: script to take backup

suhailh@yahoo.com (suhailh@yahoo.com) wrote in message news:<bde918fd.0308022137.15ac37fd@posting.google. com>...
> find /var /tmp /home | backup -ivqf /backupdir/filename
>
> i tried this but doesn't work with me, i'm running AIX 5.1?
>


Should work with 5.1, as that's the version I tested it on.

Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-04-2008, 07:49 PM
suhailh@yahoo.com
 
Posts: n/a
Default Re: script to take backup

i will try again and let you know.

Thanks for your response.

Regards,

Suhail

steve@wakefieldrfc.freeserve.co.uk (Steve Nottingham) wrote in message news:<42862645.0308040827.34d47271@posting.google. com>...
> suhailh@yahoo.com (suhailh@yahoo.com) wrote in message news:<bde918fd.0308022137.15ac37fd@posting.google. com>...
> > find /var /tmp /home | backup -ivqf /backupdir/filename
> >
> > i tried this but doesn't work with me, i'm running AIX 5.1?
> >

>
> Should work with 5.1, as that's the version I tested it on.
>
> Steve

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-04-2008, 07:54 PM
suhailh@yahoo.com
 
Posts: n/a
Default Re: script to take backup

Hello All,

thank you very much for your response.

find /abc /xyz -print |backup -ivqf /dev/rmt0

this worked for me.

i really appreciate all those who have helped me.

Regards,

Suhail


Michael W Ryder <mwryder@_earthlink_.net> wrote in message news:<KR0_a.3260$Nf3.2128@newsread4.news.pas.earth link.net>...
> suhailh@yahoo.com wrote:
>
> > i will try again and let you know.
> >
> > Thanks for your response.
> >

>
> You could try adding -print after the last directory in the list and see
> what happens. You might also want to send the output to logfiles to
> verify that everything worked correctly. That is what I do with our
> backup. It has worked fine since 3.2.25.
>
>
> > Regards,
> >
> > Suhail
> >
> > steve@wakefieldrfc.freeserve.co.uk (Steve Nottingham) wrote in message news:<42862645.0308040827.34d47271@posting.google. com>...
> >
> >>suhailh@yahoo.com (suhailh@yahoo.com) wrote in message news:<bde918fd.0308022137.15ac37fd@posting.google. com>...
> >>
> >>>find /var /tmp /home | backup -ivqf /backupdir/filename
> >>>
> >>>i tried this but doesn't work with me, i'm running AIX 5.1?
> >>>
> >>
> >>Should work with 5.1, as that's the version I tested it on.
> >>
> >>Steve

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:33 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com