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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| <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. |
| |||
| > > 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...) |
| |||
| "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 |
| |||
| "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! |
| |||
| 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 |
| |||
| 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 |
| |||
| 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 |
| ||||
| 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 |