Remote File Backup Script

I have a FreeBSD box I set up recently that I download files to.  I'd like a way to be able to, basically, sync my main computer with it and "freshen" the files, using scp to get any files/folders that aren't already present on mine.  I figure it'd involve some directory listing/text manipulation to get the list of files, then size comparisons/boundary checking and scp calls. 
My question is what would be a good language for doing this; does the text manipulation put it out of Bash's range?  Would it be more suitable for something like Python?
Also, does my idea of using scp in that way make sense, or is there an easier way?  I'm going to need to be able to do this remotely, which is why I originally thought of that.

If you are doing this as a "programming" experience, that sounds like something that could give you an interesting challenge and expand your programming horizons ... but if you are trying to "code your way out of a problem" then it is already done.
There are at least half-a-dozen programs out there that do what you want to do such as "BackupPC", Bacula, Amanda, etc.
Hope this helps.
R.

Similar Messages

  • How do I create a automated file backup script?

    I need a backup script to move files  from the MAC to Google Drive everyday at a certain time.  I tried using automator to create a calendar flow but it does not run when I set it up in calendar.  Can someone provide me a simple script template with Apple script or tell me how to do this?

    How are you backing up?   The Automator Calendar alarm should work.  Test with Automator first by creating a Workflow, then see if it works within Automator when you click "Run" 

  • I updated vietmobile remote files app. this app is broken on iOS 5.1.1 I do not have a backup of the previous version of the (paid) app, how can I roll back to the previous version? Is there a repository of previous versions? Am I boned?

    I updated vietmobile remote files app. this app is broken on iOS 5.1.1 I do not have a backup of the previous version of the (paid) app, how can I roll back to the previous version? Is there a repository of previous versions? Am I boned?
    Seems silly to not allow a rollback from a file repository of previous app versions.

    >All apps are tied to the account that downloaded it, so to be able to sync back the previous version you would need to still have your copy of that version
    I'm not sure I follow, I have not sync'd the ipad with my computer. I just saw an update in the app store and took it.
    I tried to del and install the app from the purchased tab in the app store, that reinstalled v2.1 of the app. This also fails to launch.
    I have made two service requests to the developer, no response at this time.
    Is there somewhere I can download and install Remote Files version 2 file? I can only find the new version 2.1 in the app store.

  • Control File Backups

    Hello-
    I was looking over some configurations that was setup by another DBA.
    There are 3 control files created but they all are on the same disk/directory.
    Control file auto backup is on to tape.
    If there was a hardware failure and all three control were corrupted/lost then a backup would be used but
    full recovery and RESETLOGS would be needed which would lead to redo data loss.
    If I configured 1 control file on a seperate disk. I would be able to copy this one and create 3 files again and the database
    would be started again without needing recovery if all else was fine.
    If the control keeps track of redo logs SCN, Archive logs history and RMAN backups when these change then wouldn't another control file backup/ trace need to be done ?
    Control File Trace only alllows to rebuild the database not to copy. How often is the need to taken ? Every change in the database ?
    Backup to the Flash Recovery is another backup not an updated copy to copy from but to restore/recovery with.
    Do have have these theories correct and my best setup would to send at least one to another disk.
    Thanks-

    If there was a hardware failure and all three control were corrupted/lost then a backup would be used but
    full recovery and RESETLOGS would be needed which would lead to redo data loss. No. If you lose all three controlfiles, you either
    a. RESTORE a backup of the controlfile
    OR
    b. CREATE CONTROLFILE (from a script)
    In either case, you do NOT need to do an INCOMPLETE Recovery. You will be doing a COMPLETE Recovery (if you have the Online Redo Logs). However, an OPEN RESETLOGS is still required. The %r in the log_archive_format since 10g allows ArchiveLogs to be retained through ResetLogs.
    If the control keeps track of redo logs SCN, Archive logs history and RMAN backups when these change then wouldn't another control file backup/ trace need to be done ? If you RESTORE the controlfile you lose no information. However, you still have to OPEN RESETLOGS.
    If you do a CREATE CONTROLFILE, yes, you lose information about ArchiveLogs history and RMAN Backups.
    You can issue a CATALOG command to re-catalog available Backups.
    Control File Trace only alllows to rebuild the database not to copy.A Control File Trace is to recreate the Controlfile. Not rebuild the database.
    Backup to the Flash Recovery is another backup not an updated copy to copy from but to restore/recovery with. I don't understand what your statement or question might be here.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com
    Edited by: Hemant K Chitale on Mar 2, 2011 2:44 PM
    Edited by: Hemant K Chitale on Mar 2, 2011 2:45 PM

  • Low Network Utilization in Remote Disk Backup via SAP FTP

    Hi gurus,
    I'm running whole online backup + redo log to backup my SAP server to backup server via SAPFTP (remote disk backup).
    I'm using 100Mbps network connection between the two servers, with SAP server configured to 'maximize data throughput for network application'.
    When I copy data from SAP Server to backup server manually, the speed is OK (around 98% network utilization).
    But when I use put command in program RSFTP002 (SAPFTP) for the same file, the network utilization is just around 10%.
    I use Windows Server 2003 x64 for SAP Server, and Windows Server 2008 x64 for Backup Server.
    Each has adequate RAM, 8GB for SAP Server and 4GB for Backup Server.
    Is this technical problem or is it because backup is considered background process, thus lowering its speed?
    Help will be very much appreciated.
    Edited by: Bobby Gunawan on Jan 9, 2009 11:44 AM

    go read http://help.sap.com/saphelp_45b/helpdata/en/0d/d311324a0c11d182b80000e829fbfe/frameset.htm
    it's old but should help you nonetheless.
    I would not use SAPFTP as you found out, it is slow.
    use DD instead which is much faster.

  • Re Trim file name scripts in SL

    Below is a frozen, unanswered conversation regarding the missing finder scripts in SL. Luckily, I make a complete backup before converting, so I still have all the old Leopard scripts. Norwichfan, I feel your pain, and I thought that archiving your thread without an adequate answer was wrong.
    Here's your answer. you can just get a copy of the old finder scripts, put them in /Library/Scripts and they'll show up in your script menu as before. I have zipped up a copy of them and posted them here:
    http://tedward.org/finder_scripts.zip
    norwichfan88
    Posts: 12
    From: Australia
    Registered: Mar 25, 2010
    Trim file name scripts in SL
    Posted: Mar 26, 2010 6:26 PM
    I have recently upgraded to SL and have found that the trim/add to file name applescripts from leopard are missing from my scripts menu.
    Is there a place I can find these for SL?
    MBP mid-2009 Mac OS X (10.6.2)
    Pierre L.
    Posts: 824
    From: Québec
    Registered: Jan 26, 2009
    Re: Trim file name scripts in SL
    Posted: Mar 26, 2010 6:49 PM in response to: norwichfan88
    Solved
    Maybe something similar in this web page?
    15-inch MacBook Pro 2.53 GHz Mac OS X (10.6.2) AirPort Extreme
    norwichfan88
    Posts: 12
    From: Australia
    Registered: Mar 25, 2010
    Re: Trim file name scripts in SL
    Posted: Apr 10, 2010 12:03 AM in response to: Pierre L.
    Thanks for the web page, had a look but not having done any work with applescript or other programming language was a bit over my head.
    I decided to make a temporary solution with and automator action.
    MBP mid-2009 Mac OS X (10.6.2)

    Thanks for the web page, had a look but not having done any work with applescript or other programming language was a bit over my head.
    I decided to make a temporary solution with and automator action.

  • Backup script

    I created a backup script for my data & system and i'd like to share it.
    I have a 320GB hdd (1) as my main hard drive, and a 160GB hdd (2) as a backup drive (i keep this one in a drawer nearby, disconnected from the computer).
    What i wanted was to create a partial copy of 1 on 2, such that 2 would contain the entire system (bootable) + a part of my data.
    1. You need to have the same filesystem on both (i have ext4). Maybe it works with a mix of ext3 and 4, but it's better to have just one. The partitioning scheme on hdd 1 doesn't matter, but for hdd 2 you need a single partition to which you backup.
    2. The scripts:
    backup
    #!/bin/sh
    # rsync backup script
    sudo rsync -av --delete-excluded --exclude-from="excl" / "$1"
    sudo touch "$1"/BACKUP
    This one is very simple. You rsync in archive mode (which ensures that symbolic links, devices, attributes,  permissions,  ownerships,  etc.  are preserved) and exclude the files that match the patterns from excl.
    The / is the source from where you backup (in our case the whole root) and "$1" is the destination to where you backup (this is passed as an argument to the script).
    excl
    # Include
    + /dev/console
    + /dev/initctl
    + /dev/null
    + /dev/zero
    + /media/win
    + /var/run/mpd
    + /home/wooptoo/music/Amestecate
    + /home/wooptoo/music/script
    + /home/wooptoo/music/list.txt
    + /home/wooptoo/music/.hg*
    # Exclude
    - /home/wooptoo/dl/*
    - /home/wooptoo/games/kits/*
    - /home/wooptoo/mov/*
    - /home/wooptoo/music/*
    - /dev/*
    - /media/*
    - /media/win/*
    - /mnt/*
    - /proc/*
    - /sys/*
    - /tmp/*
    - /var/run/*
    - /var/run/mpd/*
    This is a bit more tricky. It's an exclude (and include) file in rsync format.
    Exclude: I excluded my games, movies and music from the backup, and also the system directories /dev, /media, /mnt, /proc, /sys, /tmp, /var/run. These are excluded because their content is created at runtime by the system. Note that the direcotries themselves are preserved (you need them!) but they are empty.
    Include: even though i excluded /dev, i need to include 4 file from it (which are not dinamically created by udev), these are console, initctl, null, zero.
    I also included the directories /media/win and /var/run/mpd. But these are empty, because their content was excluded (in the exclude section).
    3. So we got these two files: backup and excl.
    Mount the backup hdd, let's say at /media/backup/ and run the script:
    ./backup /media/backup/
    rsync will backup the whole root to that destination. I excluded game kits, music and movies from my backup because they are just too large to fit on hdd 2, and it would also take a lot of time to backup and keep in sync afterwards.
    4. After the sync is finished you need to install a boot loader on hdd2, so you can have a working copy of your system.
    Open the grub console and type in:
    root (hd1,0)
    setup (hd1)
    The root command tells grub where your system is installed (in this case hdd 2, first partition).
    Setup tells grub where to install the boot loader. In my example it is installed in the MBR of hdd 2.
    The problem here is that the boot loader installs correctly, but its menu entries are for the partitions of the main system, not the backup system. So if you'll try to boot the backup system, it won't work.
    You can fix this by creating a custom menu.lst for the backup hdd. But i prefer not to do this, in order to have an accurate copy of my data. I just prefer to edit the entries from the boot menu on the fly if i need to boot the backup directly. But you can automatically add a custom menu.lst to the backup hdd from the backup script:
    #!/bin/sh
    # rsync backup script
    sudo rsync -av --delete-excluded --exclude-from="excl" / "$1"
    sudo cp ~/custom.menu.lst "$1"/boot/grub/menu.lst
    sudo touch "$1"/BACKUP
    5. Reboot and try out your new system.
    I think this approach (system + data backup) is better than just data backup because if something goes wrong with the main hdd, you can always swap in the backup one and continue working. Besides this, you now have another working system, from which you can recover the main one without the need of live CDs.
    In my setup both hdds are SATA with AHCI, so they are hot-pluggable. You can plugin the backup drive, run the backup script, and disconnect it. This is very advantageous because you don't have to reboot.
    But you can use an USB stick/hdd as backup drive if you only have IDE.
    I would like to know what do you think of my backup strategy. Is it good or am i doing it wrong? Are there better methods? What backup strategy do you use? etc.
    Last edited by wooptoo (2009-10-24 01:40:46)

    I use the following to rotate four backups and backup my root and home separately and hard-link common files between all the backups. I run this weekly to have backups of the last four weeks while using barely more space then one full backup would. It is not super customisable as it is my personal script and I've been wanting to add in a check to see whether the backup location is actually mounted, but I've not gotten to it just yet
    #!/bin/bash
    # Script to rotate three backups of / and /home and make a new incremental
    # backup. No arguments required. Make sure the correct disk is mounted at
    # $PAR, though!
    # Original command ran to create the first backup of /home :
    # /usr/bin/sudo /usr/bin/rsync --progress --stats -avz \
    # --exclude-from=/home/ramses/home_backup_excludes --delete-exludes \
    # /home/ /media/seadisc/home_backup.0
    # Variables and paths
    PAR="/media/seadisc/backup"
    HOME_EXCLUDES="/usr/local/bin/backup_config/home_backup_excludes"
    ROOT_EXCLUDES="/usr/local/bin/backup_config/root_backup_excludes"
    SUDO="/usr/bin/sudo"
    MV="/bin/mv"
    RM="/bin/rm"
    RSYNC="/usr/bin/rsync"
    DATE="/bin/date"
    TEE="/usr/bin/tee"
    # Home backups
    echo "Moving previous /home backups ..."
    $SUDO $RM -rf $PAR/home_backup.3
    $SUDO $MV $PAR/home_backup.2 $PAR/home_backup.3
    $SUDO $MV $PAR/home_backup2_date $PAR/home_backup3_date
    $SUDO $MV $PAR/home_backup.1 $PAR/home_backup.2
    $SUDO $MV $PAR/home_backup1_date $PAR/home_backup2_date
    $SUDO $MV $PAR/home_backup.0 $PAR/home_backup.1
    $SUDO $MV $PAR/home_backup0_date $PAR/home_backup1_date
    echo "Doing incremental backup of /home ..."
    $SUDO $RSYNC --progress --stats -av \
    --exclude-from=${HOME_EXCLUDES} \
    --delete --delete-excluded \
    --link-dest=$PAR/home_backup.1 \
    /home/ $PAR/home_backup.0
    $SUDO $DATE | $TEE $PAR/home_backup0_date > /dev/null
    # Root backups
    echo "Moving previous / backups ..."
    $SUDO $RM -rf $PAR/root_backup.3
    $SUDO $MV $PAR/root_backup.2 $PAR/root_backup.3
    $SUDO $MV $PAR/root_backup2_date $PAR/root_backup3_date
    $SUDO $MV $PAR/root_backup.1 $PAR/root_backup.2
    $SUDO $MV $PAR/root_backup1_date $PAR/root_backup2_date
    $SUDO $MV $PAR/root_backup.0 $PAR/root_backup.1
    $SUDO $MV $PAR/root_backup0_date $PAR/root_backup1_date
    echo "Doing incremental backup of / ..."
    $SUDO $RSYNC --progress --stats -av \
    --exclude-from=${ROOT_EXCLUDES} \
    --delete --delete-excluded \
    --link-dest=$PAR/root_backup.1 \
    / $PAR/root_backup.0
    $SUDO $DATE | $TEE $PAR/root_backup0_date > /dev/null

  • Remote file template not updating on website

    Hello I am very very new to dreamweaver and have been handed a website that I have to maintain and make changes to.
    The website uses a template called index with further nested templates as shown
    The index template contains the code for the Menu Bar and footer and although I have been able to make other updates and changes I am finding that any changes to the code on this template do not show up on the site. The strange thing is that both the local and remote code has updated as I would like it is just the website itself that is not changing. When I view the website source code it is different to the remote file code. I assume that the link between the two is somehow broken but I do not know how to fix it. Is there a trick to fixing such a problem or am I wrong about this being the problem?
    Here is the remote file code which is that same as the local code - I have out the code that is not updating in bold and underlined it:
    <body>
    <div class="container">
      <div class="header">
        <div id="header_top">
          <div id="text_only"><a href="http://www.genesi-fp7.eu/betsie/parser.pl">Text-only</a> </div>
           <div id="admin"><a href="../admin/index.php">admin</a> </div>
          <div id="search"><a href="../webpages/search/search.html">search</a></div>
          <div id="header_middle">
            <div id="logo_left"><img src="../images/500px-Flag_of_Europe.svg.png" alt="European Union" width="167" height="111" border="0" /></div>
            <div id="logo_middle"><img src="../images/Genesi_Logo.png" alt="GENESI" width="620" height="111" border="0" /></div>
            <div id="logo_right"><a href="http://cordis.europa.eu/home_en.html"><img src="../images/fp7.png" alt="Seventh Framework Programme" width="154" height="111" border="0" /></a></div>
          </div>
          <div id="header_bottom">
            <ul id="MainMenu" class="MenuBarHorizontal">
              <li><a href="../index.html">home</a> </li>
              <li><a href="../webpages/news/news.php">news</a></li>
    <li><a href="../webpages/programme/programme_wp1.html">programme</a></li>
    <li><a href="../webpages/consortium/consortium_0.html">consortium</a></li>
    <li><a href="../webpages/downloads/downloads.php">downloads</a></li>
    <li><a href="../webpages/links/links.html">links</a></li>
              <li><a href="../webpages/contact/contact.html">Contact</a></li>
            </ul>
          </div>
        </div>
        <!-- end .header --></div>
      <!-- TemplateBeginEditable name="mainSection" -->
      <div class="mainSection">
        <h1>here is the main section </h1>
      </div>
      <!-- TemplateEndEditable -->
      <div class="footer">
        <div id="footer_top">This project is co-financed by the <a href="http://ec.europa.eu/index_en.htm">European Commission</a> and made possible within the <a href="http://cordis.europa.eu/fp7/home_en.html">VII Framework Programme</a></div>
        <div id="footer_middle">Page maintained by <a href="mailto:[email protected]">Molly Buckingham</a> &middot; Last update: <!-- #BeginDate format:En2 -->03-Apr-2013<!-- #EndDate -->
        </div>
        <div id="footer_bottom">
          <div>&copy; 2012 <a href="../webpages/consortium/consortium_1.html">G.EN.ESI Consortium</a> &middot; <a href="../webpages/footer/Disclaimer.html">Disclaimer</a> &middot; <a href="../webpages/footer/privacy_notice.html">Privacy Statement</a></div>
        </div>
        <!-- end .footer --></div>
    And here is the source code from the website - again the code is underlined and in bold
    <!--[if lte IE 7]>
    <style>
    .content { margin-right: -1px; } /* this 1px negative margin can be placed on any of the columns in this layout with the same corrective effect. */
    ul.nav a { zoom: 1; }  /* the zoom property gives IE the hasLayout trigger it needs to correct extra whiltespace between the links */
    </style>
    <![endif]-->
    <!-- InstanceEndEditable -->
    </head>
    <body>
    <div class="container">
      <div class="header">
        <div id="header_top">
          <div id="text_only"><a href="http://www.genesi-fp7.eu/betsie/parser.pl">Text-only</a> </div>
           <div id="admin"><a href="../../admin/index.php">admin</a> </div>
          <div id="search"><a href="../search/search.html">search</a></div>
          <div id="header_middle">
            <div id="logo_left"><img src="../../images/500px-Flag_of_Europe.svg.png" alt="European Union" width="167" height="111" border="0" /></div>
            <div id="logo_middle"><img src="../../images/Genesi_Logo.png" alt="GENESI" width="620" height="111" border="0" /></div>
            <div id="logo_right"><a href="http://cordis.europa.eu/home_en.html"><img src="../../images/fp7.png" alt="Seventh Framework Programme" width="154" height="111" border="0" /></a></div>
          </div>
          <div id="header_bottom">
            <ul id="MainMenu" class="MenuBarHorizontal">
              <li><a href="../../index.html">home</a> </li>
              <li><a href="../news/news.php">news</a></li>
    <li><a href="../programme/programme_wp1.html">programme</a></li>
    <li><a href="consortium_1.html">consortium</a></li>
    <li><a href="../downloads/downloads.php">downloads</a></li>
    <li><a href="../links/links.html">links</a></li>
              <li><a href="../contact/contact.html">Contact</a></li>
            </ul>
          </div>
        </div>
        <!-- end .header --></div>
      <div class="mainSection">
        <div class="SubMenuBar">
          <ul id="SubMenu" class="MenuBarVertical">
             <li><a href="consortium_1.html">Universit&agrave; Politecnica Delle Marche</a></li>
          <li><a href="consortium_2.html">Granta Design Ltd</a></li>
          <li><a href="consortium_3.html">Faber s.p.a.</a></li>
          <li><a href="consortium_4.html">Sibuet Environnement</a></li>
          <li><a href="consortium_5.html">Bonfiglioli Vectron Gmbh</a></li>
          <li><a href="consortium_6.html">ENEA</a></li>
          <li><a href="consortium_7.html">University of Bath</a></li>
          <li><a href="consortium_8.html">Grenoble Institute of Technology</a></li>
          </ul>
        </div>
        <!-- InstanceBeginEditable name="content" -->
        <div class="content">
          <h1><strong>The Università Politecnica delle Marche</strong></h1>
          <p><img src="../../images/delle_Marche.jpg" alt="The Università Politecnica delle Marche" width="142" height="142" />The Università Politecnica delle Marche(UNIVPM)  is situated in the Marche Region (area of  Ancona) that is the one of most important European industrial districts related  to the household appliances, in fact many European leader companies such as  Indesit , Elica, Ariston TG, Faber, and many others, have their headquarters  there. Thanks to this geographical position UNIVPM has many collaborations with  these companies and it has matured a vast skill on research topics related to  the household appliances field. UNIVPM has 5 faculties, 550 professors (the  largest is the Engineering Faculty with 180 professors), 12 technical Departments  and 17,000 students; it participates to 23 academic spin-off. The central administration  of UNIVPM has a management department which gives support to technical departments  in European project set up, negotiation and administration of the grant  agreement, draft and negotiation of the consortium agreement as well as project  financial reporting. In this project will be involved the Department of  Mechanics that has a remarkable experience on European Projects since it has  been coordinator of 6th and 7th FP projects and it is involved in 9 active  European projects.  In particular, UNIVPM  coordinates the G.EN.ESI project from an administrative and technical point of  view.</p>
          <p>The scientific contact at the Università Politecnica delle Marche for the G.EN.ESI  project is Prof. Michele Germani. </p>
        </div>
        <!-- InstanceEndEditable --></div>
          <script type="text/javascript">
    var MenuBar2 = new Spry.Widget.MenuBar("SubMenu", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
      </script>
      <div class="footer">
        <div id="footer_top">This project is co-financed by the <a href="http://ec.europa.eu/index_en.htm">European Commission</a> and made possible within the <a href="http://cordis.europa.eu/fp7/home_en.html">VII Framework Programme</a></div>
        <div id="footer_middle">Page maintained by <a href="mailto:[email protected]">Chunlei Li</a> &middot; Last update: <!-- #BeginDate format:En2 -->25-Apr-2012<!-- #EndDate -->
        </div>
        <div id="footer_bottom">
          <div>&copy; 2012 <a href="consortium_1.html">G.EN.ESI Consortium</a> &middot; <a href="../footer/Disclaimer.html">Disclaimer</a> &middot; <a href="../footer/privacy_notice.html">Privacy Statement</a></div>
        </div>
        <!-- end .footer --></div>
      <!-- end .container --></div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MainMenu", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    <!-- InstanceEnd --></html>
    Thank you in advance for your help

    Jon Fritz that did actually work for some of the pages but not others. I upadted each invidivual page, except the main page as I have not finished the content and now some of the pages are acting strangely.
    Here is the website http://www.genesi-fp7.eu/index.html
    As you can see every page except the 'Contacts' and 'Links' page is now reading the correct code when you click on the 'Consortium' tab. The strange thing however is that the footer has updated on the 'Links' page suggesting that this part of the template has updated. Both these pages are based on the Index-misc nested template. The code is copied here:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/index.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <link href="../styles/genesi.css" rel="stylesheet" type="text/css" />
    <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="../SpryAssets/MainMenu.css" rel="stylesheet" type="text/css" />
    <link href="../SpryAssets/SubMenu.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="google-site-verification" content="3L2ZN1aLnNO1X__brL1UzpHsgkiL7NdjWT8oJnAxF64" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>G.EN.ESI</title>
    <!-- InstanceEndEditable -->
    <!--[if lte IE 7]>
    <style>
    .content { margin-right: -1px; } /* this 1px negative margin can be placed on any of the columns in this layout with the same corrective effect. */
    ul.nav a { zoom: 1; }  /* the zoom property gives IE the hasLayout trigger it needs to correct extra whiltespace between the links */
    </style>
    <![endif]-->
    <!-- InstanceBeginEditable name="head" -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <!-- InstanceEndEditable -->
    </head>
    <body>
    <div class="container">
      <div class="header">
        <div id="header_top">
          <div id="text_only"><a href="http://www.genesi-fp7.eu/betsie/parser.pl">Text-only</a> </div>
           <div id="admin"><a href="../admin/index.php">admin</a> </div>
          <div id="search"><a href="../webpages/search/search.html">search</a></div>
          <div id="header_middle">
            <div id="logo_left"><img src="../images/500px-Flag_of_Europe.svg.png" alt="European Union" width="167" height="111" border="0" /></div>
            <div id="logo_middle"><img src="../images/Genesi_Logo.png" alt="GENESI" width="620" height="111" border="0" /></div>
            <div id="logo_right"><a href="http://cordis.europa.eu/home_en.html"><img src="../images/fp7.png" alt="Seventh Framework Programme" width="154" height="111" border="0" /></a></div>
          </div>
          <div id="header_bottom">
            <ul id="MainMenu" class="MenuBarHorizontal">
              <li><a href="../index.html">home</a> </li>
              <li><a href="../webpages/news/news.php">news</a></li>
    <li><a href="../webpages/programme/programme_wp1.html">programme</a></li>
    <li><a href="../webpages/consortium/consortium_0.html">consortium</a></li>
    <li><a href="../webpages/downloads/downloads.php">downloads</a></li>
    <li><a href="../webpages/links/links.html">links</a></li>
              <li><a href="../webpages/contact/contact.html">Contact</a></li>
            </ul>
          </div>
        </div>
        <!-- end .header --></div>
      <!-- InstanceBeginEditable name="mainSection" -->
      <div class="mainSection">
        <div class="SubMenuBar"><!-- TemplateBeginEditable name="subMenu" -->
          <ul id="SubMenu" class="MenuBarVertical">
            <li><a href="#">MISC</a></li>
          </ul>
        <!-- TemplateEndEditable --></div>
        <!-- TemplateBeginEditable name="content" -->
        <div class="content">
          <h1>Introduction to the G.EN.ESI Project</h1>
          <p>The sustainability of industrial products, particularly  household appliances, is an important issue today.  Energy consumption in the  residential/domestic sector is about 20% of world consumption, and associated  greenhouse gas emissions exceed 35%.   Household appliances contribute greatly to these values and thus require  particular attention as far as sustainability is concerned.</p>
          <p>It is well known that decisions taken during the early  design of products are very important in determining total product cost.  It is possible to hypothesize the same for  environmental impacts – i.e. the sustainability of a product is largely  determined during the early design stage. In order to allow designers to make  well-informed decisions, new design methods and tools are needed to provide the  basis for determining the degree of sustainability of a given product or  process.  Many eco-design procedures and  tools have been developed but they are often far from a practical day-by-day  application in company engineering departments, and they are not well  integrated with computer-aided design tools.   This project wants to make up for this limitation and to develop an eco-design  methodology (called G.EN.ESI) and a related software design tool (called the  G.EN.ESI platform) able to help product designers in ecological design choices,  without losing sight of cost and typical practicalities of industry. The  software platform will propose a guided process towards eco-design among  several design choices based on the different scenarios of product lifecycle.  The proposed approach will be applied to the household appliance field but it  can be easily extended to other mechatronic products.</p>
          <p>The project started in February 2012 and will continue until  January 2015.</p>
        </div>
        <!-- TemplateEndEditable --></div>
          <script type="text/javascript">
    var MenuBar2 = new Spry.Widget.MenuBar("SubMenu", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
      </script>
      <!-- InstanceEndEditable -->
      <div class="footer">
        <div id="footer_top">This project is co-financed by the <a href="http://ec.europa.eu/index_en.htm">European Commission</a> and made possible within the <a href="http://cordis.europa.eu/fp7/home_en.html">VII Framework Programme</a></div>
        <div id="footer_middle">Page maintained by <a href="mailto:[email protected]">Molly Buckingham</a> &middot; Last update: <!-- #BeginDate format:En2 -->03-Apr-2013<!-- #EndDate -->
        </div>
        <div id="footer_bottom">
          <div>&copy; 2012 <a href="../webpages/consortium/consortium_1.html">G.EN.ESI Consortium</a> &middot; <a href="../webpages/footer/Disclaimer.html">Disclaimer</a> &middot; <a href="../webpages/footer/privacy_notice.html">Privacy Statement</a></div>
        </div>
        <!-- end .footer --></div>
      <!-- end .container --></div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MainMenu", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    <!-- InstanceEnd --></html>
    Murray do you suggest that I try and get rid of the nested templates or am I biting off more than I can chew after two days of self training?
    Thank you

  • Parallel Backup script written in python

    I'm writing a backup script in python, based on one I wrote in BASH earlier on. Both of these leverage rsync, but I decided to move to a python implementation because python is much more flexible than BASH. My goals with the new implementation are to back up the system, home folder, and my documents folder to a set of multiple primary, secondary, and tertiary disks, respectively. The method is as follows:
    1. check for the existence of disks and create folders which will contain mountpoints for each category of disk.
    2. decrypt and mount disks found under subfolders within those category folders, creating the mountpoints if they don't exist.
    3. syncronize the aforementioned data to the mounted disks using rsync, doing all three classes of disk in parallel.
    4. unmount and close disks
    This is really my first serious python program, and I realize that it's a bit complicated. My code is rather sloppy, as well, perhaps understandably so given my novice status. My only other programming experience is with BASH scripts, but I digress.
    Here is the code for the script (about 250 lines). It is written as a series of functions, and I'm uncertain as to whether functions or objects would work better. Additionally, I'm sure there's a python function provided by the os module analogous to the sync system call, but I've yet to find it in my python desk reference. The backup functions need work, and I'm still trying to figure out how to get them to loop through the mounted disks in each folder and copy to them. I require assistance in determining how to write the backup functions to do as outlined above, and how to run them in parallel. This is still a work in progress, mind.
    #!/usr/bin/python
    # Backup Script
    #### preferences ####
    # set your primary/secondary backup disks, encryption, and keyfile (if applicable) here.
    # backup disks
    # primary and secondary backups. As used here,
    # primary backups refer to backups of the entire system made to an external drive
    # secondary backups refer to backups made of individual folders, such as documents
    # primary backup disks by UUID:
    global PDISKS
    PDISKS = ("/dev/disk/by-uuid/16d64026-28bd-4e1f-a452-74e76bb4d47b","")
    # secondary backups by UUID.
    global SDISKS
    SDISKS = ()
    # tertiary disks by UUID:
    global TDISKS
    TDISKS = ("/dev/disk/by-uuid/39543e6e-cf50-4416-9669-e97a6abd2a37","")
    # backup paths
    # these are the paths of the folders you wish to back up to secondary
    # and tertiary disks, respectively. Primary disks are set to back up the
    # contents of the root filesystem (/*). NO TRAILING SLASHES.
    global SBACKUP
    SBACKUP = "/home/bryant"
    global TBACKUP
    TBACKUP = "/home/bryant/docs"
    # use encryption:
    use_encryption = True
    # keyfile
    # set the full path to your keyfile here
    # this assumes a single keyfile for all backup disks
    # set this to None if you don't have a single keyfile for all of your backups
    keyfile = "/usr/local/bin/backup.keyfile"
    # import modules
    import os, subprocess, sys
    ### preliminary functions ###
    # these do the setup and post-copy work
    def check_dirs():
    """checks that the folders which contain the mountpoints exist, creates them if they don't"""
    print("checking for mountpoints...")
    p = os.path.isdir("/mnt/pbackup")
    if p == True:
    print("primary mountpoint exists.")
    elif p == False:
    print("mountpoint /mnt/pbackup does not exist.\n\tcreating...")
    os.mkdir("/mnt/pbackup")
    s = os.path.isdir("/mnt/sbackup")
    if s == True:
    print("secondary mountpoint exists.")
    elif s == False:
    print("mountpoint /mnt/pbackup does not exist.\n\tcreating...")
    os.mkdir("/mnt/sbackup")
    t = os.path.isdir("/mnt/tbackup")
    if t == True:
    print("tertiary mountpoint exists.")
    elif t == False:
    print("mountpoint /mnt/tbackup does not exist.\n\tcreating...")
    os.mkdir("/mnt/tbackup")
    def mount_disks():
    """mounts available backup disks in their respective subdirectories"""
    pfolder = 1
    sfolder = 1
    tfolder = 1
    pmapper = "pbackup" + str(pfolder)
    smapper = "sbackup" + str(sfolder)
    tmapper = "tbackup" + str(tfolder)
    for pdisk in PDISKS:
    e = os.path.islink(pdisk)
    if e == True:
    subprocess.call("sync",shell=True)
    kf=os.path.isfile(keyfile)
    if kf == True:
    print("keyfile found. Using keyfile to decrypt...")
    subprocess.call("sudo cryptsetup luksOpen " + pdisk + " " + pmapper + " --key-file " + keyfile,shell=True)
    if kf == False:
    print("keyfile not found or keyfile not set. \t\nAsking for passphrase...")
    subprocess.call("sudo cryptsetup luksOpen " + pdisk + " " + pmapper,shell=True)
    f = os.path.isdir("/mnt/pbackup/pbak" + str(pfolder))
    if f == True:
    subprocess.call("mount " + "/dev/mapper/" + pmapper + " /mnt/pbak" + str(pfolder),shell=True)
    pfolder += 1
    elif f == False:
    os.mkdir("/mnt/pbackup/pbak" + str(pfolder))
    subprocess.call("mount " + "/dev/mapper/" + pmapper + " /mnt/pbak" + str(pfolder),shell=True)
    pfolder += 1
    for sdisk in SDISKS:
    e = os.path.islink(sdisk)
    if e == True:
    subprocess.call("sync",shell=True)
    kf=os.path.isfile(keyfile)
    if kf == True:
    print("keyfile found. Using keyfile to decrypt...")
    subprocess.call("sudo cryptsetup luksOpen " + sdisk + " " + smapper + " --key-file " + keyfile,shell=True)
    if kf == False:
    print("keyfile not found or keyfile not set. \t\nAsking for passphrase...")
    subprocess.call("sudo cryptsetup luksOpen " + sdisk + " " + smapper,shell=True)
    f = os.path.isdir("/mnt/sbackup/sbak" + str(sfolder))
    if f == True:
    subprocess.call("mount " + "/dev/mapper/" + smapper + " /mnt/sbackup/sbak" + str(sfolder),shell=True)
    sfolder += 1
    elif f == False:
    os.mkdir("/mnt/sbackup/sbak" + str(folder))
    subprocess.call("mount " + "/dev/mapper/" + smapper + " /mnt/sbackup/sbak" + str(sfolder),shell=True)
    sfolder += 1
    for tdisk in TDISKS:
    e = os.path.islink(tdisk)
    if e == True:
    subprocess.call("sync",shell=True)
    kf=os.path.isfile(keyfile)
    if kf == True:
    print("keyfile found. Using keyfile to decrypt...")
    subprocess.call("sudo cryptsetup luksOpen " + tdisk + " " + tmapper + " --key-file " + keyfile,shell=True)
    if kf == False:
    print("keyfile not found or keyfile not set. \t\nAsking for passphrase...")
    subprocess.call("sudo cryptsetup luksOpen " + tdisk + " " + tmapper,shell=True)
    f = os.path.isdir("/mnt/tbackup/tbak" + str(tfolder))
    if f == True:
    subprocess.call("mount " + "/dev/mapper/" + tmapper + " /mnt/pbak" + str(tfolder),shell=True)
    tfolder += 1
    elif f == False:
    os.mkdir("/mnt/tbackup/tbak" + str(tfolder))
    subprocess.call("mount " + "/dev/mapper/" + tmapper + " /mnt/tbak" + str(tfolder),shell=True)
    tfolder += 1
    def umount_disks():
    """unmounts and relocks disks"""
    subprocess.call("umount /mnt/pbackup*",shell=True)
    subprocess.call("umount /mnt/sbackup*",shell=True)
    subprocess.call("umount /mnt/tbackup*",shell=True)
    subprocess.call("cryptsetup luksClose /dev/mapper/pbackup*",shell=True)
    subprocess.call("cryptsetup luksClose /dev/mapper/sbackup*",shell=True)
    subprocess.call("cryptsetup luksClose /dev/mapper/tbackup*",shell=True)
    def check_disks():
    """checks to see how many disks exist, exits program if none are attached"""
    pdisknum = 0
    sdisknum = 0
    tdisknum = 0
    for pdisk in PDISKS:
    p = os.path.islink(pdisk)
    if p == True:
    pdisknum += 1
    elif p == False:
    print("disk " + pdisk + " not detected.")
    for sdisk in SDISKS:
    s = os.path.islink(sdisk)
    if s == True:
    sdisknum += 1
    elif s == False:
    print("disk " + sdisk + " not detected.")
    for tdisk in TDISKS:
    t = os.path.islink(tdisk)
    if t == True:
    tdisknum += 1
    elif t == False:
    print("disk " + tdisk + " not detected.")
    total = pdisknum + sdisknum + tdisknum
    if total == 0:
    print("ERROR: no disks detected.")
    sys.exit()
    elif total > 0:
    print("found " + str(total) + " attached backup disks")
    print(str(pdisknum) + " Primary")
    print(str(sdisknum) + " secondary")
    print(str(tdisknum) + " tertiary")
    return total, pdisknum, sdisknum, tdisknum
    ### backup functions ###
    # these need serious work. Need to get them to loop through available mounted
    # disks in their categories and then execute rsync
    def pbackup():
    """calls rsync to backup the entire system to all pdisks"""
    dirs = os.listdir("/mnt/pbackup")
    for dir in dirs:
    m = os.path.ismount(dir)
    if m == True:
    subprocess.call("sync",shell=True)
    print("syncing disks with rsync...")
    # subprocess.call("rsync --progress --human-readable --numeric-ids --inplace --verbose --archive --delete-after --hard-links --xattrs --delete --compress --skip-compress={*.jpg,*.bz2,*.gz,*.tar,*.tar.gz,*.ogg,*.mp3,*.tar.xz,*.avi} /* /mnt/pbackup/" + dir + "/ --exclude={/sys/*,/mnt/*,/proc/*,/dev/*,/lost+found,/media/*,/tmp/*,/home/*/.gvfs/*,/home/*/downloads/*,/opt/*,/run/*",shell=True)
    print("test1")
    subprocess.call("sync",shell=True)
    print("disk synced with disk " + pdisk + ".")
    print("sync with disk " + pdisk + " complete.")
    elif m == False:
    continue
    def sbackup():
    """calls rsync to backup everything under SBACKUP folder to all sdisks"""
    dirs = os.listdir("/mnt/sbackup")
    for dir in dirs:
    m = os.path.ismount(dir)
    if m == True:
    subprocess.call("sync",shell=True)
    # subprocess.call("rsync --progress --human-readable --numeric-ids --inplace --verbose --archive --delete-after --hard-links --xattrs --delete --compress --skip-compress={*.jpg,*.bz2,*.gz,*.tar,*.tar.gz,*.ogg,*.mp3,*.tar.xz,*.avi} SBACKUP/* /mnt/sbackup/" + dir + "/",shell=True)
    print("test2")
    subprocess.call("sync",shell=True)
    print("disk synced with disk " + pdisk + ".")
    print("sync with disk " + sdisk + " complete.")
    elif m == False:
    continue
    def tbackup():
    """calls rsync to backup everything under TBACKUP folder to all tdisks"""
    dirs = os.listdir("/mnt/tbackup")
    for dir in dirs:
    m = os.path.ismount(dir)
    if m == True:
    subprocess.call("sync",shell=True)
    # subprocess.call("rsync --progress --human-readable --numeric-ids --inplace --verbose --archive --delete-after --hard-links --xattrs --delete --compress --skip-compress={*.jpg,*.bz2,*.gz,*.tar,*.tar.gz,*.ogg,*.mp3,*.tar.xz,*.avi} TBACKUP/* /mnt/sbackup/" + dir + "/",shell=True)
    print("test3")
    subprocess.call("sync",shell=True)
    print("disk synced with disk " + pdisk + ".")
    print("sync with disk " + sdisk + " complete.")
    elif m == False:
    continue
    #### main ####
    # check for root access:
    r=os.getuid()
    if r != 0:
    print("ERROR: script not run as root.\n\tThis script MUST be run as root user.")
    sys.exit()
    elif r == 0:
    # program body
    check_dirs()
    check_disks()
    mount_disks()
    # pbackup()
    # sbackup()
    tbackup()
    umount_disks()
    print("backup process complete.")
    Last edited by ParanoidAndroid (2013-08-07 20:01:07)

    I've run into a problem on line 149. I'm asking the program to list the directories under the top-level backup directories under /mnt, check to see if each one is a mountpoint, and if it is unmount it. It does this, but it appears to recurse into the directories under the directories I'm asking it to check. The output is:
    checking for mountpoints...
    primary mountpoint exists.
    secondary mountpoint exists.
    tertiary mountpoint exists.
    disk /dev/disk/by-uuid/16d64026-28bd-4e1f-a452-74e76bb4d47b not detected.
    found 1 attached backup disks
    0 Primary
    0 secondary
    1 tertiary
    keyfile found. Using keyfile to decrypt...
    mounting tbackup1 at /mnt/tbak1
    test3
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    not a mountpoint
    Device /dev/mapper/pbackup* is not active.
    Device /dev/mapper/sbackup* is not active.
    backup process complete.
    here is the code for the entire script. It's been much modified from the previously posted version, so I included all of the code versus the section in question for reference. As I said, the section that seems to be causing the issue is on line 149.
    #!/usr/bin/python
    # Backup Script
    #### preferences ####
    # set your primary/secondary backup disks, encryption, and keyfile (if applicable) here.
    # backup disks
    # primary and secondary backups. As used here,
    # primary backups refer to backups of the entire system made to an external drive
    # secondary backups refer to backups made of individual folders, such as documents
    # primary backup disks by UUID:
    global PDISKS
    PDISKS = ["/dev/disk/by-uuid/16d64026-28bd-4e1f-a452-74e76bb4d47b"]
    # secondary backups by UUID.
    global SDISKS
    SDISKS = []
    # tertiary disks by UUID:
    global TDISKS
    TDISKS = ["/dev/disk/by-uuid/39543e6e-cf50-4416-9669-e97a6abd2a37"]
    # backup paths
    # these are the paths of the folders you wish to back up to secondary
    # and tertiary disks, respectively. Primary disks are set to back up the
    # contents of the root filesystem (/*). NO TRAILING SLASHES.
    global SBACKUP
    SBACKUP = "/home/bryant"
    global TBACKUP
    TBACKUP = "/home/bryant/docs"
    # use encryption:
    use_encryption = True
    # keyfile
    # set the full path to your keyfile here
    # this assumes a single keyfile for all backup disks
    # set this to None if you don't have a single keyfile for all of your backups
    keyfile = "/usr/local/bin/backup.keyfile"
    # import modules
    import os, subprocess, sys
    ### preliminary functions ###
    # these do the setup and post-copy work
    def check_dirs():
    """checks that the folders which contain the mountpoints exist, creates them if they don't"""
    print("checking for mountpoints...")
    if os.path.isdir("/mnt/pbackup"):
    print("primary mountpoint exists.")
    else:
    print("mountpoint /mnt/pbackup does not exist.\n\tcreating...")
    os.mkdir("/mnt/pbackup")
    if os.path.isdir("/mnt/sbackup"):
    print("secondary mountpoint exists.")
    else:
    print("mountpoint /mnt/pbackup does not exist.\n\tcreating...")
    os.mkdir("/mnt/sbackup")
    if os.path.isdir("/mnt/tbackup"):
    print("tertiary mountpoint exists.")
    else:
    print("mountpoint /mnt/tbackup does not exist.\n\tcreating...")
    os.mkdir("/mnt/tbackup")
    def mount_disks(wdisk):
    """mounts available backup disks in their respective subdirectories"""
    pfolder = 1
    sfolder = 1
    tfolder = 1
    pmapper = "pbackup"
    smapper = "sbackup"
    tmapper = "tbackup"
    if wdisk == "p":
    for pdisk in PDISKS:
    if os.path.islink(pdisk):
    subprocess.call("sync",shell=True)
    if os.path.isfile(keyfile):
    print("keyfile found. Using keyfile to decrypt...")
    subprocess.call("sudo cryptsetup luksOpen " + pdisk + " " + pmapper + str(pfolder) + " --key-file " + keyfile,shell=True)
    else:
    print("keyfile not found or keyfile not set. \t\nAsking for passphrase...")
    subprocess.call("sudo cryptsetup luksOpen " + pdisk + " " + pmapper + str(pfolder),shell=True)
    if os.path.isdir("/mnt/pbackup/pbak" + str(pfolder)):
    print("mounting " + pmapper + str(pfolder) + " at /mnt/pbak" + str(pfolder))
    subprocess.call("mount " + "/dev/mapper/" + pmapper + str(pfolder) + " /mnt/pbackup/pbak" + str(pfolder),shell=True)
    pfolder += 1
    else:
    os.mkdir("/mnt/pbackup/pbak" + str(pfolder))
    subprocess.call("mount " + "/dev/mapper/" + pmapper + str(pfolder) + " /mnt/pbackup/pbak" + str(pfolder),shell=True)
    pfolder += 1
    elif wdisk == "s":
    for sdisk in SDISKS:
    if os.path.islink(sdisk):
    subprocess.call("sync",shell=True)
    if os.path.isfile(keyfile):
    print("keyfile found. Using keyfile to decrypt...")
    subprocess.call("sudo cryptsetup luksOpen " + sdisk + " " + smapper + str(sfolder) + " --key-file " + keyfile,shell=True)
    else:
    print("keyfile not found or keyfile not set. \t\nAsking for passphrase...")
    subprocess.call("sudo cryptsetup luksOpen " + sdisk + " " + smapper + str(sfolder),shell=True)
    if os.path.isdir("/mnt/sbackup/sbak" + str(sfolder)):
    print("mounting " + smapper + str(sfolder) + " at /mnt/sbak" + str(sfolder))
    subprocess.call("mount " + "/dev/mapper/" + smapper + str(sfolder) + " /mnt/sbackup/sbak" + str(sfolder),shell=True)
    sfolder += 1
    else:
    os.mkdir("/mnt/sbackup/sbak" + str(folder))
    subprocess.call("mount " + "/dev/mapper/" + smapper + str(sfolder) + " /mnt/sbackup/sbak" + str(sfolder),shell=True)
    sfolder += 1
    elif wdisk == "t":
    for tdisk in TDISKS:
    if os.path.islink(tdisk):
    subprocess.call("sync",shell=True)
    if os.path.isfile(keyfile):
    print("keyfile found. Using keyfile to decrypt...")
    subprocess.call("sudo cryptsetup luksOpen " + tdisk + " " + tmapper + str(tfolder) + " --key-file " + keyfile,shell=True)
    else:
    print("keyfile not found or keyfile not set. \t\nAsking for passphrase...")
    subprocess.call("sudo cryptsetup luksOpen " + tdisk + " " + tmapper + str(tfolder),shell=True)
    if os.path.isdir("/mnt/tbackup/tbak" + str(tfolder)):
    print("mounting " + tmapper + str(tfolder) + " at /mnt/tbak" + str(tfolder))
    subprocess.call("mount " + "/dev/mapper/" + tmapper + str(tfolder) + " /mnt/tbackup/tbak" + str(tfolder),shell=True)
    if os.path.islink(tdisk):
    tfolder += 1
    else:
    os.mkdir("/mnt/tbackup/tbak" + str(tfolder))
    subprocess.call("mount " + "/dev/mapper/" + tmapper + " /mnt/tbackup/tbak" + str(tfolder),shell=True)
    tfolder += 1
    def umount_disks():
    """unmounts and relocks disks"""
    pdirs = os.listdir("/mnt/pbackup")
    sdirs = os.listdir("/mnt/sbackup")
    tdirs = os.listdir("/mnt/tbackup")
    for pdir in pdirs:
    if os.path.ismount("/mnt/pbackup/" + pdir):
    subprocess.call("umount /mnt/pbackup/" + pdir,shell=True)
    else:
    print("not a mountpoint")
    for sdir in sdirs:
    if os.path.ismount("/mnt/sbackup/" + sdir):
    subprocess.call("umount /mnt/sbackup/" + sdir,shell=True)
    else:
    print("not a mountpoint")
    for tdir in tdirs:
    if os.path.ismount("/mnt/tbackup/" + tdir):
    subprocess.call("umount /mnt/tbackup/" + tdir,shell=True)
    else:
    print("not a mountpoint")
    subprocess.call("cryptsetup luksClose /dev/mapper/pbackup*",shell=True)
    subprocess.call("cryptsetup luksClose /dev/mapper/sbackup*",shell=True)
    subprocess.call("cryptsetup luksClose /dev/mapper/tbackup*",shell=True)
    def check_disks():
    """checks to see how many disks exist, exits program if none are attached"""
    pdisknum = 0
    sdisknum = 0
    tdisknum = 0
    for pdisk in PDISKS:
    if os.path.islink(pdisk):
    pdisknum += 1
    else:
    print("\ndisk " + pdisk + " not detected.")
    for sdisk in SDISKS:
    if os.path.islink(sdisk):
    sdisknum += 1
    else:
    print("\ndisk " + sdisk + " not detected.")
    for tdisk in TDISKS:
    if os.path.islink(tdisk):
    tdisknum += 1
    else:
    print("\ndisk " + tdisk + " not detected.")
    total = pdisknum + sdisknum + tdisknum
    if total == 0:
    print("\nERROR: no disks detected.")
    sys.exit()
    elif total > 0:
    print("found " + str(total) + " attached backup disks")
    print(str(pdisknum) + " Primary")
    print(str(sdisknum) + " secondary")
    print(str(tdisknum) + " tertiary")
    return total, pdisknum, sdisknum, tdisknum
    ### backup functions ###
    # these need serious work. Need to get them to loop through available mounted
    # disks in their categories and then execute rsync
    def pbackup():
    """calls rsync to backup the entire system to all pdisks"""
    dirs = os.listdir("/mnt/pbackup")
    for dir in dirs:
    if os.path.ismount("/mnt/pbackup/" + dir) == True:
    subprocess.call("sync",shell=True)
    print("syncing disks with rsync...")
    subprocess.call("rsync --progress --human-readable --numeric-ids --inplace --verbose --archive --delete-after --hard-links --xattrs --delete --compress --skip-compress={*.jpg,*.bz2,*.gz,*.tar,*.tar.gz,*.ogg,*.mp3,*.tar.xz,*.avi} /* /mnt/pbackup/" + dir + "/ --exclude={/sys/*,/mnt/*,/proc/*,/dev/*,/lost+found,/media/*,/tmp/*,/home/*/.gvfs/*,/home/*/downloads/*,/opt/*,/run/*",shell=True)
    subprocess.call("sync",shell=True)
    else:
    continue
    def sbackup():
    """calls rsync to backup everything under SBACKUP folder to all sdisks"""
    dirs = os.listdir("/mnt/sbackup")
    for dir in dirs:
    if os.path.ismount("/mnt/sbackup/" + dir):
    subprocess.call("sync",shell=True)
    subprocess.call("rsync --progress --human-readable --numeric-ids --inplace --verbose --archive --delete-after --hard-links --xattrs --delete --compress --skip-compress={*.jpg,*.bz2,*.gz,*.tar,*.tar.gz,*.ogg,*.mp3,*.tar.xz,*.avi} " + SBACKUP + "/* /mnt/sbackup/" + dir + "/",shell=True)
    subprocess.call("sync",shell=True)
    else:
    continue
    def tbackup():
    """calls rsync to backup everything under TBACKUP folder to all tdisks"""
    dirs = os.listdir("/mnt/tbackup")
    for dir in dirs:
    if os.path.ismount("/mnt/tbackup/" + dir):
    subprocess.call("sync",shell=True)
    subprocess.call("rsync --progress --human-readable --numeric-ids --inplace --verbose --archive --delete-after --hard-links --xattrs --delete --compress --skip-compress={*.jpg,*.bz2,*.gz,*.tar,*.tar.gz,*.ogg,*.mp3,*.tar.xz,*.avi} " + TBACKUP + "/* /mnt/sbackup/" + dir + "/",shell=True)
    subprocess.call("sync",shell=True)
    else:
    continue
    #### main ####
    # check for root access:
    r=os.getuid()
    if r != 0:
    print("ERROR: script not run as root.\n\tThis script MUST be run as root user.")
    sys.exit()
    elif r == 0:
    # program body
    check_dirs()
    d=check_disks()
    if d[1] > 0:
    mount_disks("p")
    pbackup()
    elif d[2] > 0:
    mount_disks("s")
    sbackup()
    elif d[3] > 0:
    mount_disks("t")
    tbackup()
    umount_disks()
    print("backup process complete.")
    Last edited by ParanoidAndroid (2013-08-11 00:32:02)

  • Unix Backup Script Question

    Hello -
    I want to compare file system dates (on AIX) for a backup script. For example, after the backup completes, I want to compare the timestamps on each backed up file with the the time the backup started. I should not see any timestamps prior to the start time of the backup.
    Does anyone know how to do this in Unix?
    Any help is greatly appreciated!
    Thanks,
    Mike

    At the beginning of your backup use the touch command on a flag file of some kind. This will set the modified date to the current system time.
    At the end of your backup compare the modified time of the flag file to the other files. Something like:
    touch flag.file
    < do your backup >
    filelist=`ls filespec for files of interest`
    for f in $filelist
    do
       if [ $f -nt flag.test ]; then
          report it
       fi
    done[pre]
    HTH
    John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Schedule backup script ICM

    Hello,
    I'm trying to backup script (*.ICMS) with schedule task, do you now if it's possible?
    I find the manual export in script editor but do it one by one ...
    I need your help
    Thanks a lot

    You cannot "back up" an individual .icms file.
    If you back up the logger (xxxx_sideA) database, that will include all the Scripts (along with all your other configuration).
    iow - the Scripts are part of the ICM database, not a separate entity.

  • Control file backup is hung.

    Hi,
    When I initiate control file backup it is struck.  Pls. see my Rman configuration.
    RMAN> show all;
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
    CONFIGURE BACKUP OPTIMIZATION OFF; # default
    CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oracle/rmanbkup/cf%F';
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default
    CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/oracle/rmanbkup/%U';
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
    CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/S01/102_64/dbs/snapcf_S01.f'; # default
    RMAN> backup current controlfile;
    Starting backup at 28-JUN-09
    using channel ORA_DISK_1
    It is in this situation since 4 Hrs. 
    I had set all the permissions as mentioned in the SAP Note : 113747.  Backup was happening as normal till 25th June thru DB13.
    My observation is, I had alter the  oracle parameter as per the  quiry results.  ( i.e added the events ..  I  had executed the script attached  in the S.Note : 1171650.  ST04 --> Performance --> Additional Function --> SQL Command Editor )
    O/S :  AIX 5.3,
    DB : Oracle  10.2.0.2.0
    ECC 6.0
    Backup in all other servers are happening without any problem..
    I appreciate  your  expert suggestions.
    Thanks!
    Sundaresh Suryanarayan

    Hi Surendara Jain,
    Still this problem persisting.. I have tried all.. I checked all the relevent S-Notes.  I updated the brtools version also..
    Even if I execute BRBACKUP it starts.. It creates the folder. But, the folder will be empty.. Pls. see the *.and file below..
    MBES01:oras01 10> more beayrvav.and
    BR0051I BRBACKUP 7.00 (41)
    BR0055I Start of database backup: beayrvav.and 2009-07-07 08.12.17
    BR0484I BRBACKUP log file: /oracle/S01/sapbackup/beayrvav.and
    BR0477I Oracle pfile /oracle/S01/102_64/dbs/initS01.ora created from spfile /oracle/S01/102_64/dbs/spfileS01.ora
    BR0101I Parameters
    Name                           Value
    oracle_sid                     S01
    oracle_home                    /oracle/S01/102_64
    oracle_profile                 /oracle/S01/102_64/dbs/initS01.ora
    sapdata_home                   /oracle/S01
    sap_profile                    /oracle/S01/102_64/dbs/initS01.sap
    backup_mode                    ALL
    backup_type                    online
    backup_dev_type                disk
    backup_root_dir                /oracle/S01/sapbackup
    compress                       no
    disk_copy_cmd                  rman
    cpio_disk_flags                -pdcu
    exec_parallel                  0
    rman_compress                  no
    system_info                    oras01/oras01 MBES01 AIX 3 5 00CD16724C00
    oracle_info                    S01 10.2.0.2.0 8192 2959 21202296 MBES01 UTF8 UTF8
    sap_info                       700 SAPSR3 0002LK0003S010011E21297128880015Maintenance_ORA
    make_info                      rs6000_64 OCI_102 Apr  8 2009
    command_line                   /usr/sap/S01/SYS/exe/run/brbackup -p initS01.sap -d disk -t online -m all -k no -e 0 -o dist,time -l E -U
    BR0116I ARCHIVE LOG LIST before backup for database instance S01
    Parameter                      Value
    Database log mode              Archive Mode
    Automatic archival             Enabled
    Archive destination            /oracle/S01/oraarch/S01arch
    Archive format                 %t_%s_%r.dbf
    Oldest online log sequence     2956
    Next log sequence to archive   2959
    Current log sequence           2959             SCN: 21202296
    Database block size            8192             Thread: 1
    Current system change number   21209894         ResetId: 674792151
    BR0118I Tablespaces and data files
    Tablespace     TS-Status  F-Status  File                                                       Size   Id.     Device  Link    Type     
    MaxSize     IncrSize  BlkSize
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_1/sr3.data1                 2579505152    4     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_10/sr3.data10               1069555712   13     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_2/sr3.data2                 2558533632    5     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_3/sr3.data3                 3334479872    6     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_4/sr3.data4                 3984596992    7     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_5/sr3.data5                 3166707712    8     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_6/sr3.data6                 2998935552    9     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_7/sr3.data7                 2977964032   10     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_8/sr3.data8                 2852134912   11     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3        ONLINE*    ONLINE+   /oracle/S01/sapdata2/sr3_9/sr3.data9                 2810191872   12     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3700     ONLINE*    ONLINE+   /oracle/S01/sapdata3/sr3700_1/sr3700.data1           3523223552   14     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3700     ONLINE*    ONLINE+   /oracle/S01/sapdata3/sr3700_2/sr3700.data2           4299169792   15     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3700     ONLINE*    ONLINE+   /oracle/S01/sapdata3/sr3700_3/sr3700.data3           3607109632   16     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3700     ONLINE*    ONLINE+   /oracle/S01/sapdata3/sr3700_4/sr3700.data4           3428851712   17     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3DB      ONLINE*    ONLINE+   /oracle/S01/sapdata4/sr3db_1/sr3db.data1             2097160192   19     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3DB      ONLINE*    ONLINE+   /oracle/S01/sapdata4/sr3db_2/sr3db.data2             2097160192   20     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3DB      ONLINE*    ONLINE+   /oracle/S01/sapdata4/sr3db_3/sr3db.data3             1048584192   21     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPSR3USR     ONLINE*    ONLINE+   /oracle/S01/sapdata4/sr3usr_1/sr3usr.data1             20979712   18     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPTEMP       ONLINE#    ONLINE+   /oracle/S01/sapdata1/temp_1/temp.data1               1017126912   -1     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    PSAPUNDO       ONLINE-    ONLINE+   /oracle/S01/sapdata1/undo_1/undo.data1               2705334272    2     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    SYSAUX         ONLINE*    ONLINE+   /oracle/S01/sapdata1/sysaux_1/sysaux.data1            230694912    3     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    SYSTEM         ONLINE*    SYSTEM+   /oracle/S01/sapdata1/system_1/system.data1            513810432    1     3276802  NOLINK  FILE   104
    85760000     20971520     8192
    BR0119I Redo log files
    File                                                Size  Group     Device  Status    Link    Type
    /oracle/S01/origlogA/log_g11m1.dbf              52429312    1      3276802  INUSE     NOLINK  FILE
    /oracle/S01/mirrlogA/log_g11m2.dbf              52429312    1      3276802  INUSE     NOLINK  FILE
    /oracle/S01/origlogB/log_g12m1.dbf              52429312    2      3276802  INUSE     NOLINK  FILE
    /oracle/S01/mirrlogB/log_g12m2.dbf              52429312    2      3276802  INUSE     NOLINK  FILE
    /oracle/S01/origlogA/log_g13m1.dbf              52429312    3      3276802  INUSE     NOLINK  FILE
    /oracle/S01/mirrlogA/log_g13m2.dbf              52429312    3      3276802  INUSE     NOLINK  FILE
    /oracle/S01/origlogB/log_g14m1.dbf              52429312    4      3276802  INUSE     NOLINK  FILE
    /oracle/S01/mirrlogB/log_g14m2.dbf              52429312    4      3276802  INUSE     NOLINK  FILE
    BR0120I Control files
    File                                                Size   Id.      Device  Link    Type
    /oracle/S01/origlogA/cntrl/cntrlS01.dbf         14368768    0      3276802  NOLINK  FILE
    /oracle/S01/origlogB/cntrl/cntrlS01.dbf         14368768    0      3276802  NOLINK  FILE
    /oracle/S01/sapdata1/cntrl/cntrlS01.dbf         14368768    0      3276802  NOLINK  FILE
    BR0616I Tablespaces in table TSORA for SAP owner SAPSR3:
    PSAPSR3, PSAPSR3700, PSAPSR3USR
    BR0379I Distribution of files on volume #1:
    Position        Size         Rate      Compressed    Duration     Speed   Name
                                                           [m:s]      [MB/h]
        1     2579505152*                                   2:19      63712   /oracle/S01/sapdata2/sr3_1/sr3.data1
        2     1069555712*                                   0:59      62238   /oracle/S01/sapdata2/sr3_10/sr3.data10
        3     2558533632*                                   2:19      63194   /oracle/S01/sapdata2/sr3_2/sr3.data2
        4     3334479872*                                   2:48      68143   /oracle/S01/sapdata2/sr3_3/sr3.data3
        5     3984596992*                                   3:19      68744   /oracle/S01/sapdata2/sr3_4/sr3.data4
        6     3166707712*                                   2:49      64332   /oracle/S01/sapdata2/sr3_5/sr3.data5
        7     2998935552*                                   2:38      65165   /oracle/S01/sapdata2/sr3_6/sr3.data6
        8     2977964032*                                   2:39      64302   /oracle/S01/sapdata2/sr3_7/sr3.data7
        9     2852134912*                                   2:28      66162   /oracle/S01/sapdata2/sr3_8/sr3.data8
       10     2810191872*                                   2:29      64752   /oracle/S01/sapdata2/sr3_9/sr3.data9
       11     3523223552*                                   2:49      71574   /oracle/S01/sapdata3/sr3700_1/sr3700.data1
       12     4299169792*                                   3:38      67707   /oracle/S01/sapdata3/sr3700_2/sr3700.data2
       13     3607109632*                                   3:09      65524   /oracle/S01/sapdata3/sr3700_3/sr3700.data3
       14     3428851712*                                   2:48      70072   /oracle/S01/sapdata3/sr3700_4/sr3700.data4
       15     2097160192*                                   1:59      60504   /oracle/S01/sapdata4/sr3db_1/sr3db.data1
       16     2097160192*                                   1:58      61017   /oracle/S01/sapdata4/sr3db_2/sr3db.data2
       17     1048584192*                                   0:59      61017   /oracle/S01/sapdata4/sr3db_3/sr3db.data3
       18       20979712*                                   0:06      12005   /oracle/S01/sapdata4/sr3usr_1/sr3usr.data1
       19     2705334272*                                   2:19      66820   /oracle/S01/sapdata1/undo_1/undo.data1
       20      230694912*                                   0:19      41686   /oracle/S01/sapdata1/sysaux_1/sysaux.data1
       21      513810432*                                   0:38      46422   /oracle/S01/sapdata1/system_1/system.data1
       22       14368768                                    0:00          0*  /oracle/S01/sapbackup/cntrlS01.dbf
    Total:   51919052800*                                  45:29      65317
    BR0284I BRBACKUP time stamp: 2009-07-07 08.12.19, elapsed time: 0:00
    BR0057I Backup of database: S01
    BR0058I BRBACKUP action ID: beayrvav
    BR0059I BRBACKUP function ID: and
    BR0110I Backup mode: ALL
    BR0077I Database file for backup: /oracle/S01/sapbackup/cntrlS01.dbf
    BR0061I 22 files found for backup, total size 49513.867 MB
    BR0143I Backup type: online
    BR0112I Files will not be compressed
    BR0130I Backup device type: disk
    BR0106I Files will be saved on disk in directory: /oracle/S01/sapbackup/beayrvav
    BR0284I BRBACKUP time stamp: 2009-07-07 08.12.19, elapsed time: 0:00
    BR0256I Enter 'c[ont]' to continue, 's[top]' to cancel BRBACKUP:
    BR0284I BRBACKUP time stamp: 2009-07-07 08.12.54, elapsed time: 0:35
    BR0257I Your reply: 'c'
    BR0259I Program execution will be continued...
    BR0370I Directory /oracle/S01/sapbackup/beayrvav created
    end **************************************************
    it won't move furthe after this.. I checked and compared SPFILE & init<SID>.sap with other servers (DEV,QA & PRD) all are same.. But, backup is happening on those server without any problem. 
    Can anybody help me on this..
    Thanks!
    Sundaresh Suryanarayan

  • Rman hot backup script  gives error in R12.

    hi experts
    i m facing following prob when run the backup script. 1 day before the same script runs correctily but now  it gives me error at the allocatioion of channel rest of command run correctly.
    [root@testerp rman_log]# cat UAT_daily_rman_hot_bkp_01-11-14_140301.log
    -bash: /root/.bash_profile: Permission denied
    Recovery Manager: Release 11.1.0.7.0 - Production on Sat Jan 11 14:03:01 2014
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    connected to target database: UAT (DBID=2855851979)
    connected to recovery catalog database
    RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12>
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "end-of-file": expecting one of: "allocate, alter, advise, backup, beginline, blockrecover, catalog, change, copy, convert, crosscheck, configure, duplicate, debug, delete, execute, endinline, flashback, host, mount, open, plsql, recover, release, replicate, report, restore, resync, repair, }, set, setlimit, sql, switch, startup, shutdown, send, show, transport, validate"
    RMAN-01007: at line 12 column 1 file: standard input
    RMAN>
    RMAN>
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "identifier": expecting one of: "for"
    RMAN-01008: the bad identifier was: c2
    RMAN-01007: at line 1 column 18 file: standard input
    RMAN>
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "identifier": expecting one of: "for"
    RMAN-01008: the bad identifier was: c3
    RMAN-01007: at line 1 column 18 file: standard input
    RMAN>
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "identifier": expecting one of: "for"
    RMAN-01008: the bad identifier was: c4
    RMAN-01007: at line 1 column 18 file: standard input
    RMAN>
    Starting backup at 11-JAN-14
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=362 device type=DISK
    channel ORA_DISK_1: starting incremental level 1 datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00021 name=/d06/UAT/proddata/a_txn_data06.dbf
    input datafile file number=00392 name=/d06/UAT/db/apps_st/data/a_txn_data01.dbf
    input datafile file number=00401 name=/d06/UAT/db/apps_st/data/a_txn_data02.dbf
    input datafile file number=00402 name=/d06/UAT/db/apps_st/data/a_txn_data03.dbf
    input datafile file number=00022 name=/d06/UAT/proddata/a_txn_data07.dbf
    input datafile file number=00014 name=/d06/UAT/db/apps_st/data/a_txn_data04.dbf
    input datafile file number=00020 name=/d06/UAT/proddata/a_txn_data05.dbf
    input datafile file number=00011 name=/d06/UAT/db/apps_st/data/sysaux01.dbf
    input datafile file number=00018 name=/d06/UAT/db/apps_st/data/sysaux02.dbf
    input datafile file number=00023 name=/d06/UAT/proddata/a_txn_data08.dbf
    input datafile file number=00379 name=/d06/UAT/db/apps_st/data/undo01.dbf
    input datafile file number=00024 name=/d06/UAT/proddata/sysaux03.dbf
    input datafile file number=00025 name=/d06/UAT/proddata/sysaux04.dbf
    input datafile file number=00033 name=/d06/UAT/proddata/a_txn_ind11.dbf
    input datafile file number=00029 name=/d06/UAT/proddata/a_txn_ind09.dbf
    input datafile file number=00030 name=/d06/UAT/proddata/a_txn_ind10.dbf
    input datafile file number=00015 name=/d06/UAT/db/apps_st/data/a_txn_ind06.dbf
    input datafile file number=00026 name=/d06/UAT/db/apps_st/data/a_txn_ind07.dbf
    input datafile file number=00028 name=/d06/UAT/db/apps_st/data/a_txn_ind08.dbf
    input datafile file number=00393 name=/d06/UAT/db/apps_st/data/a_txn_ind01.dbf
    input datafile file number=00403 name=/d06/UAT/db/apps_st/data/a_txn_ind02.dbf
    input datafile file number=00404 name=/d06/UAT/db/apps_st/data/a_txn_ind03.dbf
    input datafile file number=00405 name=/d06/UAT/db/apps_st/data/a_txn_ind04.dbf
    input datafile file number=00406 name=/d06/UAT/db/apps_st/data/a_txn_ind05.dbf
    input datafile file number=00400 name=/d06/UAT/db/apps_st/data/a_media01.dbf
    input datafile file number=00353 name=/d06/UAT/db/apps_st/data/system08.dbf
    input datafile file number=00013 name=/d06/UAT/db/apps_st/data/system12.dbf
    input datafile file number=00352 name=/d06/UAT/db/apps_st/data/system09.dbf
    input datafile file number=00394 name=/d06/UAT/db/apps_st/data/a_ref01.dbf
    input datafile file number=00407 name=/d06/UAT/db/apps_st/data/a_ref02.dbf
    input datafile file number=00396 name=/d06/UAT/db/apps_st/data/a_summ01.dbf
    input datafile file number=00395 name=/d06/UAT/db/apps_st/data/a_int01.dbf
    input datafile file number=00008 name=/d06/UAT/db/apps_st/data/a_queue02.dbf
    input datafile file number=00027 name=/d06/UAT/db/apps_st/data/a_queue03.dbf
    input datafile file number=00031 name=/d06/UAT/db/apps_st/data/a_queue04.dbf
    input datafile file number=00399 name=/d06/UAT/db/apps_st/data/a_queue01.dbf
    input datafile file number=00001 name=/d06/UAT/db/apps_st/data/system01.dbf
    input datafile file number=00002 name=/d06/UAT/db/apps_st/data/system02.dbf
    input datafile file number=00003 name=/d06/UAT/db/apps_st/data/system03.dbf
    input datafile file number=00004 name=/d06/UAT/db/apps_st/data/system04.dbf
    input datafile file number=00005 name=/d06/UAT/db/apps_st/data/system05.dbf
    input datafile file number=00398 name=/d06/UAT/db/apps_st/data/a_archive01.dbf
    input datafile file number=00295 name=/d06/UAT/db/apps_st/data/system06.dbf
    input datafile file number=00351 name=/d06/UAT/db/apps_st/data/system07.dbf
    input datafile file number=00354 name=/d06/UAT/db/apps_st/data/system11.dbf
    input datafile file number=00288 name=/d06/UAT/db/apps_st/data/system10.dbf
    input datafile file number=00012 name=/d06/UAT/db/apps_st/data/apps_ts_tools01.dbf
    input datafile file number=00016 name=/d06/UAT/db/apps_st/data/a_ref03.dbf
    input datafile file number=00019 name=/d06/UAT/db/apps_st/data/MLSEIGL01.dbf
    input datafile file number=00032 name=/d06/UAT/db/apps_st/data/RMAN01.dbf
    input datafile file number=00397 name=/d06/UAT/db/apps_st/data/a_nolog01.dbf
    input datafile file number=00314 name=/d06/UAT/db/apps_st/data/portal01.dbf
    input datafile file number=00017 name=/d06/UAT/db/apps_st/data/a_int02.dbf
    input datafile file number=00006 name=/d06/UAT/db/apps_st/data/ctxd01.dbf
    input datafile file number=00010 name=/d06/UAT/db/apps_st/data/olap.dbf
    input datafile file number=00009 name=/d06/UAT/db/apps_st/data/odm.dbf
    input datafile file number=00007 name=/d06/UAT/db/apps_st/data/owad01.dbf
    channel ORA_DISK_1: starting piece 1 at 11-JAN-14
    [root@testerp rman_log]#
    backup script is below:
    in this script it returns error only at the channel allocaition rest of all backup command i run manually or with scirpt it runs correctly.4
    i m not able to know why it returns error only at challnel allocation 1 day before it runs correctly.
    [orauat@testerp rman_script]$ cat rman_backup.sh
    #!/bin/sh
    #ORACLE_SID=UAT
    #BACKUP_START_TIME='date +"%y""%m""%d"_"%H""%M""%S"'
    #ORACLE_HOME=/d06/UAT/db/tech_st/11.1.0
    #PATH=$PATH:${ORACLE_HOME}:${ORACLE_HOME}/bin
    #export ORACLE_SID
    #export ORACLE_HOME
    #export PATH
    /d06/UAT/db/tech_st/11.1.0/bin/rman catalog rman/rman007 target sys/sysuat <<EOF
    run
    allocate channel c1 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_Arch_%c_%U';
    sql 'alter system switch logfile';
    sql 'alter system switch logfile';
    sql 'alter system archive log current';
    delete expired archivelog all;
    crosscheck archivelog all;
    backup archivelog all;
    delete noprompt archivelog all completed before 'sysdate-4' backed up 1 times to disk;
    allocate channel c2 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    allocate channel c3 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    allocate channel c4 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    backup incremental level 1 database;
    delete expired backup device type disk;
    delete obsolete device type disk;
    release channel c1;
    release channel c2;
    release channel c3;
    release channel c4;
    exit
    EOF
    regards
    pritesh ranjan

    yes the script is edited
    i have add some command line and edit it for take the full backup level=0 on the same directory with different formant name but location is same.
    can i take full backup level 0 and incremental backup level 1 in the same directory with the different format name.
    for exp:
    allocate channel c2 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    allocate channel c3 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    allocate channel c4 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    i allocate these three channel for incremental level 1 backup;
    the backup is done successfully without any error.
    after that i have change
    allocate channel c2 device type disk format '/d06/UAT/rman_hot_backup/Weekly_backup%d_DB_%c_%U';
    allocate channel c3 device type disk format '/d06/UAT/rman_hot_backup/Weekly_backup%d_DB_%c_%U';
    allocate channel c4 device type disk format '/d06/UAT/rman_hot_backup/Weekly_backup%d_DB_%c_%U';
    backup  database incremental level 0
    after doing the above changes it get the error. with the channel location.
    i have to schedule daily incremental backup level 1 and weekly full backup level 0.
    plz suggest me i have to take incremental 1 and full incremental level 0 backup on seperate directory for different format name.
    regards
    pritesh ranjan

  • RAC(OPS) 환경 하에서 ARCHIVED LOG FILE을 BACKUP 받는 방법

    제품 : RMAN
    작성날짜 : 2004-11-26
    RAC(OPS) 환경하에서 양쪽 Node의 archived log file을 RMAN을 사용하여 동시에 BACKUP 받는 방법
    ======================================================================================
    ORACLE 9i 이전 버전
    Oracle 8i까지는 다음과 같은 Script를 통하여 Backup을 받을 수 있었습니다.
    1) Script Name: arch_backup.rcv
    run{
    allocate channel node_1 type disk connect 'system/manager@v92hp1';
    allocate channel node_2 type disk connect 'system/manager@v92hp2';
    backup filesperset 1
    (archivelog until time 'SYSDATE' thread 1 channel node_1)
    (archivelog until time 'SYSDATE' thread 2 channel node_2);
    release channel node_1;
    release channel node_2;
    2) 수행 방법
    $ rman target=system/manager catalog=rman_user/rmanpw cmdfile='arch_backup.rcv' log='arch_backup.log'
    ORACLE 9i 이후 버전
    그러나 Oracle9i 이상부터는 Archived file backup전에 다음과 같은 설정을 먼저
    해 주셔야만 합니다.
    1) Configuration 설정
    $ rman target=system/manager catalog=rman_user/rmanpw
    RMAN> Show all;
    RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    RMAN> configure default device type to disk;
    RMAN> configure channel 1 device type disk connect 'system/manager@v92hp1';
    RMAN> configure channel 2 device type disk connect 'system/manager@v92hp2';
    위 설정은 backup을 Disk에 받는 경우로 가정하고 device type을 모두 disk로 설정하였습니다.
    만일 backup solution을 사용하여 tape에 받는다면 device type을 'sbt_tape'으로 변경해 주시면 됩니다
    몇개의 Channel을 설정할 것인가에 따라 PARALLELISM의 값을 반드시맞춰 주어야 합니다.
    이것을 맞춰주지 않으면 다음과 같은 형태의 Error가 발생하면서 다른 Node의 archive file들을 인식하지
    못하게 됩니다.(실제로 Archived file들은 정상적으로 존재합니다)
    RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
    ORA-19625: error identifying file /u01/64bit/app/oracle/product/9.2.0/admin/V92HP/arch/arch1_146.dbf
    ORA-27037: unable to obtain file status
    HP-UX Error: 2: No such file or directory
    Additional information: 3
    위 설정은 한번만 수행해 주시면 됩니다.
    만일 CHANNEL을 잘못 설정하였으면 다음과 같은 명령으로 Clear 해 주시면 됩니다.
    RMAN> configure channel 1 device type disk clear;
    2)Archived file을 Backup 받습니다.
    RMAN> run { backup
    format='/u01/64bit/app/oracle/product/9.2.0/admin/V92HP/arch/%U'
    archivelog all delete input;
    ADDITIONAL INFORMATION(1)
    RAC 환경 하에서 일부 Archived file들이 OS에서 삭제 되었을 경우 다음과 같은 명령을 통하여
    validation check를 수행한 후에 backup을 수행하여 주십시요
    RMAN> allocate channel for maintenance type disk connect 'system/manager@v92hp1';
    RMAN> allocate channel for maintenance type disk connect 'system/manager@v92hp2';
    RMAN> crosscheck archivelog all;
    만약에 Configuration에서 이미 Channel을 설정해 주었다면
    Channel allocation 없이 바로 crosscheck명령어를 수행해 주시면 됩니다.
    ADDITIONAL INFORMATION(2)
    Channel Configuration 설정시에 Backup FORMAT을 함께 설정하려면 다음과 같은 형태로 수행합니다.
    RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    RMAN> configure default device type to disk;
    RMAN> configure channel 1 device type disk connect 'system/manager@v92hp1' FORMAT '/arch/bkup%t_s%s_s%p';
    RMAN> configure channel 2 device type disk connect 'system/manager@v92hp2' FORMAT '/arch/bkup%t_s%s_s%p';
    ADDITIONAL INFORMATION(3)
    Tape device를 사용할 경우 device type은 'sbt_tape'을 사용합니다.
    RMAN> CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2;
    RMAN> configure default device type to 'sbt_tape';
    RMAN> configure channel 1 device type 'sbt_tape' connect 'system/manager@v92hp1' FORMAT 'bkup%t_s%s_s%p';
    RMAN> configure channel 2 device type 'sbt_tape' connect 'system/manager@v92hp2' FORMAT 'bkup%t_s%s_s%p';

  • [SOLVED] File backup strategy

    Hi,
    I have a cronjob running backup script every 8hrs to make timestamped tar archive of important stuff.
    Basically, i just wanted to know if there's some more elegant way of achieving the same/better effect as, for some reason, i don't feel this is the right way of doing it.
    0 */8 * * * sh /home/pentago/.backup/cron-backup > /dev/null 2>&1
    Backup script:
    #!/bin/zsh
    cd /home/pentago/.backup && \
    tar cvpf backup-`date +%d.%m.%y--%I.%M%p`.tar $(cat /home/pentago/.backup/files) \
    --exclude="/home/pentago/Public" \
    --exclude="/home/pentago/.irssi/logs" \
    --exclude="/home/pentago/.config/google-chrome" \
    --exclude="/home/pentago/.config/sublime-text-3/Cache" \
    --exclude="/home/pentago/.config/sublime-text-3/Backup" \
    --exclude="/home/pentago/.config/sublime-text-3/Index" \
    --exclude="/home/pentago/.Skype/shared_dynco" \
    --exclude="/home/pentago/.Skype/shared_httpfe" \
    --exclude="/home/pentago/.Skype/DbTemp" \
    --exclude="/home/pentago/.Skype/shared.lck" \
    --exclude="/home/pentago/.Skype/user.name/chatsync" \
    --exclude="/home/pentago/.Skype/user.name/httpfe" \
    --exclude="/home/pentago/.Skype/user.name/voicemail" \
    --exclude="/home/pentago/.Skype/user.name/*.db" \
    --exclude="/home/pentago/.Skype/user.name/*.db-journal" \
    --exclude="/home/pentago/.Skype/user.name/*.lock" \
    --exclude="/home/pentago/.Skype/user.name/*.lck" \
    --exclude="/home/pentago/.Skype/user.name2/chatsync" \
    --exclude="/home/pentago/.Skype/user.name2/httpfe" \
    --exclude="/home/pentago/.Skype/user.name2/voicemail" \
    --exclude="/home/pentago/.Skype/user.name2/*.db" \
    --exclude="/home/pentago/.Skype/user.name2/*.db-journal" \
    --exclude="/home/pentago/.Skype/user.name2/*.lock" \
    --exclude="/home/pentago/.Skype/user.name2/*.lck" \
    Backed up files:
    /home/pentago/Downloads
    /home/pentago/Music
    /home/pentago/Pictures
    /home/pentago/Public
    /home/pentago/Videos
    /home/pentago/.config
    /home/pentago/.asoundrc
    /home/pentago/.elinks
    /home/pentago/.filezilla
    /home/pentago/.fonts
    /home/pentago/.gimp-2.8
    /home/pentago/.irssi
    /home/pentago/.mpd
    /home/pentago/.mpdconf
    /home/pentago/.packages
    /home/pentago/.share-credentials
    /home/pentago/.Skype
    /home/pentago/.ssh
    /home/pentago/.vim
    /home/pentago/.gtk-bookmarks
    /home/pentago/.tmux.conf
    /home/pentago/.vimrc
    /home/pentago/.xinitrc
    /home/pentago/.Xresources
    /home/pentago/.zshrc
    /etc/fstab
    /etc/hostname
    /etc/locale.conf
    /etc/locale.gen
    /etc/locale.nopurge
    /etc/localtime
    /etc/ntp.conf
    /etc/ssh/sshd_config
    /etc/pacman.conf
    /etc/makepkg.conf
    /etc/netctl/wlp3s0
    /etc/netctl/enp4s0
    /etc/pacman.d/mirrorlist
    /etc/samba/smb.conf
    /etc/ufw/ufw.conf
    /etc/vconsole.conf
    /etc/X11/xorg.conf.d/50-synaptics.conf
    /usr/lib/ufw/user.rules
    /usr/lib/ufw/user6.rules
    Thanks.
    Last edited by pentago (2013-11-22 18:29:52)

    As graysky said, this isn't exactly a backup, it's more a history of your files. If you're willing to use BTRFS (I am on many computers without a problem) you might be better off using subvolumes and snapshots. I setup a script which takes snapshots of my home directory which is called through cron like:
    */10 * * * * snap 10m 12
    0 * * * * snap 1h 24
    0 0,12 * * * snap hd 14
    0 13 * * * snap 1d 30
    The first argument to snap is an arbitrary label and the second is the number of copies of that label to keep (first in first out). So I keep 2 hours of 10-minute snapshots and 2 weeks of half-day snapshots of my home directory. Also, I have ~/Local and ~/.cache as separate subvolumes so that they are not included.
    I also take snapshots in two other places:
    - Whenever I log in I run "snap profile 5" so that I have a snapshot created for my previous 5 logins (tty, X11, ssh, tmux, etc).
    - Whenever I run my personal rsync wrapper to another host.
    Elaborating in the second item, I have 5 machines which are configured in the same way. I manually run my rsync wrapper to sync among them (so I usually need to keep track of my most recently used machine to avoid my files from diverging). The rsync wrapper calls "snap <source-hostname> 3" so that I also have snapshots created before I sync files between two hostnames.
    So you get the idea, I currently have all of these snapshots:
    @2013-11-17 00:00:01 MST - hd @2013-11-25 18:58:13 MST - profile @2013-12-03 17:00:01 MST - 1h @2013-12-04 20:00:01 MST - 1h
    @2013-11-17 12:00:01 MST - hd @2013-11-25 19:01:41 MST - spruce @2013-12-03 18:00:01 MST - 1h @2013-12-04 20:30:01 MST - 10m
    @2013-11-17 13:00:01 MST - 1d @2013-11-26 10:32:28 MST - profile @2013-12-03 19:00:01 MST - 1h @2013-12-04 20:40:01 MST - 10m
    @2013-11-18 00:00:01 MST - hd @2013-11-26 10:33:19 MST - profile @2013-12-03 20:00:01 MST - 1h @2013-12-04 20:50:01 MST - 10m
    @2013-11-19 00:00:01 MST - hd @2013-11-26 12:26:14 MST - profile @2013-12-03 22:00:01 MST - 1h @2013-12-04 21:00:01 MST - 10m
    @2013-11-22 00:00:01 MST - hd @2013-11-26 13:00:01 MST - 1d @2013-12-03 23:00:01 MST - 1h @2013-12-04 21:00:01 MST - 1h
    @2013-11-22 09:53:13 MST - sunflower @2013-11-26 22:52:20 MST - profile @2013-12-04 07:00:01 MST - 1h @2013-12-04 21:10:01 MST - 10m
    @2013-11-22 09:59:24 MST - sunflower @2013-12-02 14:02:55 MST - profile @2013-12-04 08:00:01 MST - 1h @2013-12-04 21:20:01 MST - 10m
    @2013-11-22 12:00:01 MST - hd @2013-12-02 14:16:07 MST - profile @2013-12-04 09:00:01 MST - 1h @2013-12-04 21:30:01 MST - 10m
    @2013-11-23 00:00:01 MST - hd @2013-12-03 09:00:01 MST - 1h @2013-12-04 10:00:01 MST - 1h @2013-12-04 21:40:01 MST - 10m
    @2013-11-24 13:00:26 MST - 1d @2013-12-03 10:00:01 MST - 1h @2013-12-04 11:00:01 MST - 1h @2013-12-04 21:50:01 MST - 10m
    @2013-11-24 20:30:27 MST - sunflower @2013-12-03 11:00:01 MST - 1h @2013-12-04 12:00:01 MST - 1h @2013-12-04 22:00:01 MST - 10m
    @2013-11-25 09:34:19 MST - profile @2013-12-03 12:00:01 MST - 1h @2013-12-04 12:00:01 MST - hd @2013-12-04 22:00:01 MST - 1h
    @2013-11-25 09:43:12 MST - old mutt config @2013-12-03 12:00:01 MST - hd @2013-12-04 15:53:35 MST - spruce @2013-12-04 22:10:01 MST - 10m
    @2013-11-25 09:43:51 MST - old mutt config @2013-12-03 13:00:01 MST - 1d @2013-12-04 16:00:01 MST - 1h @2013-12-04 22:20:01 MST - 10m
    @2013-11-25 12:00:01 MST - hd @2013-12-03 13:00:01 MST - 1h @2013-12-04 17:00:01 MST - 1h @head
    @2013-11-25 13:00:01 MST - 1d @2013-12-03 16:31:21 MST - profile @2013-12-04 18:00:01 MST - 1h
    @2013-11-25 14:54:05 MST - profile @2013-12-03 16:31:32 MST - spruce @2013-12-04 19:00:01 MST - 1h
    It seems like a lot, but they barely take up any space.
    @head is my actual home directory and is the only read/write subvolume, all of the other snapshots are immutable.
    Last edited by dgbaley27 (2013-12-05 05:30:27)

Maybe you are looking for

  • I just reinstalled PSE 9 and now my edit effects panel doesn't work when I click on it. Help!

    If anybody had this problem and has the solution, please share and I'll be a happy camper again. I have Window Vista. Thanks.

  • How to change Amts in Assets'-- G/L Reconciliation Acctts after closing

    Hi Experts, I want to change / modify the Accumulated Depreciation Amounts for some Fixed Assets-->>G/L reconciliation Accounts. This I want to do in the very first initial year (2005) - when the assets were first loaded / transferred from legacy sys

  • PSE 7 Editor Not Working

    My editor is not working.   When I try to open, window comes up inside editor screen and says "Adobe Photoshop Editor has Stopped Working"   This has never happened and the organizer is still working.   Help someone!!!

  • Isvalid in a query

    Hi, Please can someone tell me/explain if it is possible to use isvalid in a query to get data. The code that does not work is below, it will explain what I am trying to do. I know I can loop through the results to get the relevant data after the que

  • Attributes  monitored in a JMS destination

              Hello           I am using WLS 7.0, SP1. I was trying to locate the documentation for the different           attributes which get monitored when I open the WLS console to monitor a queue.           What is the difference between the follow