DVD Backup Script

Holy trial and error batman!
ok, after weeks of banging my head against the wall i think i finally got this working.  so here it is, a script to rip - compress - and burn a DVD9 to standard 4.7 GB DVD5.
why? because lxdvd fails, dvd95 usually fails, and k9copy brings in unwanted dependencies and never remembers my settings between sessions.
i have not tested this extensively but i think it's workable enough to post for now, in it's current form.  take, enjoy, multiply and prosper.
Disclaimer 1: i'm not in any way condoning or encouraging copyright infringement
Disclaimer 2: if this script burns your house down (or anything else goes wrong) i accept no responsibility
one thing i would love to add is the ability to add chapter markers.  neither vobcopy -I or tcprobe give me the needed info to build a ch.lst.  so any suggestions on that would be appreciated.
here's the script:
#!/bin/bash
# DvdCopy V 0.1
# pbrisbin 2009
# Requires:
# bc
# transcode (tcprobe)
# vobcopy
# mplayer (mencoder)
# dvdauthor
# cdrkit or cdrtools (mkisofs and growisofs)
# sudoers ability to `sudo /usr/bin/eject` w/o password
### Editable User Settings
DEV="/dev/sr0"
WD="/home/patrick/Temp/ripping"
### Below this shouldn't need to edited unless
### you intend to adjust the behavior of the
### actual program
### Some set up
# Set up a working directory as defined above. we
# need ~10GB here to hold all the files needed to
# run this script as-is
[ -d $WD ] || mkdir $WD
### Find the Longest Title
# some dvd's need mencoder to call dvd://N where N is
# the title to copy. it should auto detect longest
# but we'll help it out by calling vobcopy -I to find
# it manually just in case
vobcopy -I $DEV 2>&1 | tee $WD/title.txt
TITLE=$(grep Most\ chapters $WD/title.txt | awk '{print $6}')
echo ""
echo -e "\n\n The longest title was Title \e[1;34m${TITLE}\e[0m. Proceed with this title? y/n " && read A
echo ""
[ "$A" = "y" ] || exit
### Gather INFO on the DVD
# tcprobe is annoying and always prints to screen
tcprobe -i $DEV -T $TITLE 2>&1 > $WD/probe.txt || exit
### Calculate the Video Bitrate
# an equation is used to calculate a vbitrate to
# keep the final .mpeg under the limit $S. $S is
# 4.3GB to allow some wiggle room. quality seems
# ok with this setting, change it if you want.
S="4300000"
L="$(grep ^V\: $WD/probe.txt | awk '{print $4}')"
a="$(grep ^A\: $WD/probe.txt | awk '{print $5}')"
A="$(echo "$a / 8" | bc)"
VBR="$(echo "( ( $S - ( $A * $L ) ) / $L ) * 8" | bc)"
echo ""
echo -e "Your calculated bitrate is: \e[1;34m${VBR}\e[0m"
echo ""
### Get the Chapter Listing
# use tcprobe with more verbosity to get the chapter
# listing, this is minipulated into a file that's
# called later by dvdauthor -c. we need to find a more
# elegant way to handle this failing, but then again
# i'm not sure how often it will fail, if ever
tcprobe -i $DEV -T $TITLE -d 8 2>&1 | egrep "\[Chapter ..\] " | cut -d " " -f 4 | \
perl -pi -e 's/\n/,/' | perl -pi -e 's/,$//' | tee $WD/ch.list || exit
echo -e "\n $(cat $WD/ch.list) \n"
echo ""
echo -e "\n\n Check the chapters, you should see 0,00:10:00.0,...\n\n Is it ok? y/n " && read A
echo ""
[ "$A" = "y" ] || exit # cop out!
### Finally, we can encode the Video
# these settings build an NTSC DVD compliant mpg with
# a straight copy of the audio and a vbitrate calculated
# to keep it under the 4.4 GB limit defined above
mencoder dvd://${TITLE} -dvd-device $DEV -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
-vf scale=720:480,harddup \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=${VBR}:\
keyint=18:vstrict=0:aspect=16/9 -ofps 30000/1001 \
-oac copy \
-o $WD/file.mpeg || exit 1
### Author the DVD folder
# we need to set it up such that if the ch.list fails
# then we can choose to do an interval - chapters each
# 10 15 minutes or something, dynamically set up a file
# then conditionally call -c ch.list or -c fallback.list
if [ -f $WD/ch.list ]; then
dvdauthor -t -c $(cat $WD/ch.list) -o $WD/MOVIE $WD/file.mpeg || exit 2
else
dvdauthor -t -o $WD/MOVIE $WD/file.mpeg || exit 2
fi
# TOC is required so it's playable in standard players
dvdauthor -T -o $WD/MOVIE || exit 2
### Build the ISO image
# this is done so that the .iso can be saved or burnt
# to disc in the next step
mkisofs -dvd-video -o $WD/movie.iso $WD/MOVIE || exit 3
# prepare to burn, eject the disc and ask for a blank
# one. sudoers file needs to be edited to allow access
# to this command w/o a password
sudo /usr/bin/eject $DEV || exit 4
read -p "Please insert a blank DVD-R and press any key to continue:"
### Burn the ISO image
# wait 5 seconds for the drive to settle then burn the
# iso to disk. this line can cab used directly on the
# $WD/MOVIE folder if you're never going to keep the
# ISO image file on disk
sleep 5 && growisofs -dvd-compat -Z $DEV=$WD/movie.iso || exit 5
# Now that we're done let's clean up the Temp data
# the user is asked b/c we might want to keep the .iso
echo -e "\n\n Seems we're all set. Would you like to remove the Temp data? y/n\n" && read A
[ "$A" = "y" ] && rm -r $WD
echo -e "Enjoy your movie!"
exit 0
edit1: almost forgot, i call eject in the script which requires root privileges on my system.  do the usual `sudo visudo` routine so you can do that w/o password or the script will choke at that point.  alternatively you can put an exit right there and just eject/burn manually from there.
edit2: in the script i run mkisofs to make the .iso, then i burn that with growisofs.  i do this because occasionally i like to keep the .iso on my HDD for a while.  if this isn't needed, you can run this to burn directly from $WD/MOVIE to disc:
growisofs -dvd-compat -Z $DEV -dvd-video $WD/MOVIE/
edit3: figured out the chapters listing... added to script
edit4: thanks skottish... this _should_ work.  testers welcome
edit5: 'final' version posted, dependencies listed.  enjoy!
edit6: just a cleaner and more commented version.  no major changes
edit7: moved the title finding section to the top so i could then us $TITLE everywhere to be safe
Last edited by brisbin33 (2009-03-27 21:27:35)

OK, for the sake of completeness, here's the final version i've been using successfully of late.  the only thing i might add is some better error handling.  thanks juster for the fixes, i love hiding output in scripts and was very annoyed that tcprobe/vobcopy wasn't behaving.  hope this works for you, suggestions always welcome
#!/bin/bash
# DvdCopy V 0.1
# pbrisbin 2009
# Requires:
# bc
# transcode (tcprobe)
# vobcopy
# mplayer (mencoder)
# dvdauthor
# cdrkit or cdrtools (mkisofs and growisofs)
# sudoers ability to `sudo /usr/bin/eject` w/o password
### Editable User Settings
DEV="/dev/sr0"
WD="$HOME/Temp/ripping"
### Below this, shouldn't need to edited unless
### you intend to adjust the behavior of the
### actual program
### Some set up
# Set up a working directory as defined above. we
# need ~10GB here to hold all the files needed to
# run this script as-is
[ -d $WD ] || mkdir -p $WD
### Find the Longest Title
# some dvd's need mencoder to call dvd://N where N is
# the title to copy. it should auto detect longest
# but we'll help it out by calling vobcopy -I to find
# it manually just in case
vobcopy -I $DEV > $WD/title.txt 2>&1 || exit
TITLE=$(grep Most\ chapters $WD/title.txt | awk '{print $6}')
echo ""
echo -e "\n\n The longest title was Title \e[1;34m${TITLE}\e[0m. Proceed with this title? y/n " && read A
echo ""
[ "$A" = "y" ] || exit
### Gather INFO on the DVD
# tcprobe is annoying and always prints to screen
tcprobe -i $DEV -T $TITLE -d 8 > $WD/probe.txt 2>&1 || exit
### Calculate the Video Bitrate
# an equation is used to calculate a vbitrate to
# keep the final .mpeg under the limit $S. $S is
# 4.3GB to allow some wiggle room. quality seems
# ok with this setting, change it if you want.
S="4300000"
L="$(grep ^V\: $WD/probe.txt | awk '{print $4}')"
a="$(grep ^A\: $WD/probe.txt | awk '{print $5}')"
A="$(echo "$a / 8" | bc)"
VBR="$(echo "( ( $S - ( $A * $L ) ) / $L ) * 8" | bc)"
echo ""
echo -e "\n Your calculated bitrate is: \e[1;34m${VBR}\e[0m"
echo ""
### Get the Chapter Listing
# using that first tcprobe (-d 8) to get the chapter
# listing, this is minipulated into a file that's
# called later by dvdauthor -c. we need to find a more
# elegant way to handle this failing, but then again
# i'm not sure how often it will fail, if ever...
egrep "\[Chapter ..\] " $WD/probe.txt | cut -d " " -f 4 | \
perl -pi -e 's/\n/,/' | perl -pi -e 's/,$//' > $WD/ch.list || exit
### Display the Chapter
# let's display the chapters in a more readable format
# do the reverse of above, we'll be confident the file's
# ok if the listing look's good
echo -e "\n Your Chapters were determined as follows: \n"
count=1
cat $WD/ch.list | sed 's/\,/\n/g' | while read chap; do
echo -e "\tChapter $count \t- \e[1;34m$chap\e[0m"
count=$(( count + 1 ))
done
echo ""
echo -e "\n Chapters look ok? y/n " && read A
echo ""
[ "$A" = "y" ] || exit # cop out!
### Finally, we can encode the Video
# these settings build an NTSC DVD compliant mpg with
# a straight copy of the audio and a vbitrate calculated
# to keep it under the 4.4 GB limit defined above
mencoder dvd://${TITLE} -dvd-device $DEV -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
-vf scale=720:480,harddup \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=${VBR}:\
keyint=18:vstrict=0:aspect=16/9 -ofps 30000/1001 \
-oac copy \
-o $WD/file.mpeg || exit 1
### Author the DVD folder
# we need to set it up such that if the ch.list fails
# then we can choose to do an interval - chapters each
# 10 15 minutes or something, dynamically set up a file
# then conditionally call -c ch.list or -c fallback.list
if [ -f $WD/ch.list ]; then
dvdauthor -t -c $(cat $WD/ch.list) -o $WD/MOVIE $WD/file.mpeg || exit 2
else
dvdauthor -t -o $WD/MOVIE $WD/file.mpeg || exit 2
fi
# TOC is required so it's playable in standard players
dvdauthor -T -o $WD/MOVIE || exit 2
### Build the ISO image
# this is done so that the .iso can be saved or burnt
# to disc in the next step
mkisofs -dvd-video -o $WD/movie.iso $WD/MOVIE || exit 3
# prepare to burn, eject the disc and ask for a blank
# one. sudoers file needs to be edited to allow access
# to this command w/o a password
sudo /usr/bin/eject $DEV || exit 4
read -p " Please insert a blank DVD-R and press any key to continue:"
### Burn the ISO image
# wait 5 seconds for the drive to settle then burn the
# iso to disk. this line can cab used directly on the
# $WD/MOVIE folder if you're never going to keep the
# ISO image file on disk
sleep 5 && growisofs -dvd-compat -Z $DEV=$WD/movie.iso || exit 5
# Now that we're done let's clean up the Temp data
# the user is asked b/c we might want to keep the .iso
echo -e "\n\n Seems we're all set. Would you like to remove the Temp data? y/n\n" && read A
[ "$A" = "y" ] && rm -r $WD
echo -e "\n\n Enjoy your movie!"
exit 0

Similar Messages

  • How do I create a dvd backup of library in the very latest iTunes,with windows xp?

    How do I create a dvd backup of library with itunes version 11.1.4.62? Using windows xp.

    Hi meatmailbox,
    Welcome to the Support Communities!
    The best way to backup your iTunes library is to an external hard drive.  The article below will explain how to do this.   If you want the files on a CD or DVD, you would need to create playlists.  I'll include that information as well.
    iTunes: Back up your iTunes library by copying to an external hard drive
    http://support.apple.com/kb/HT1751
    iTunes 11 for Windows: Create your own CDs and DVDs
    http://support.apple.com/kb/PH12348
    Cheers,
    - Judy

  • What is "error 4480" while doing a data DVD backup

    I am running Windows Vista (blergh) and I get an "error 4480" burn failure every time I try to do a data DVD backup of my iTunes library.
    What is that error and how do I fix it? My CD/DVD drivers are all up to date.
    Other OS Windows Vista
      Windows XP  

    What brand of discs are you using, and at what burn speed? Also, which drive is in your computer?

  • 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

  • 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" 

  • 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.

  • A decent cold backup script

    Oracle version : 11G release 2
    Platform : AIX
    After going through various OTN posts, i wrote the below Cold backup script (Untested). If there are any unnecessary stuff or enhancements required, please let me know
    $ rman target /
    RMAN>
    run
         allocate channel c1  type disk format '/u05/rmanbkp/%d_COLD_DB_%u';
         sql 'alter system archive log current';
         shutdown immediate;
         startup mount;
         backup database including current controlfile tag='mydbname_full_bkp';
         backup spfile tag = 'mydbname_SPFILE';
         release channel c1;
    }

    Hi T.Boyd
    What do you guys think of the backup script? Any room for improvement? I found in a small percentage of the shutdown immediate commands issued, the instance hangs (specially when the machine is very busy).
    I have modified my rman coldbackup the procedure to:
    shutdown abort;
    host 'sleep 3';
    startup restrict;
    shutdown immediate;
    startup mount;Maybe you can add more channels to improve performance. You can use more resources as there are no users on the database anyway....
    Regards,
    Tycho

  • Asking for tips or suggestions re: DVD backups and compression

    Hey there all.  I'm hoping to get some nice DVD backups from dual layered DVD9 discs so that they can potentially fit on DVD5.  I would really love to keep the DVD menus that are on the discs (special features, subtitles, and so fourth.)
    I've seen the following threads which have proven somewhat helpful, but they are rather out dated:
    https://bbs.archlinux.org/viewtopic.php … 60#p525660
    https://bbs.archlinux.org/viewtopic.php?id=53344
    I've looked at k9copy but am afraid of all the dependencies it pulls up with it.  It does the job though, maybe with telecine errors in some cases from what I've seen testing it.
    vobcopy seems very promising, especially when using the following com
    vobcopy -m /mounted/dvd/
    It backs up the entire DVD successfully from what I've seen, but not compressed at all.  (but it does retain the menus and the all wanted special features and various subtitle selections).
    So, "vamps" may bring what I need to the table - I hope.
    vamps -e 1.50 -a 1 < ./large.vob > ./small.vob
    That above, would supposedly turn a 7.5 gb .vob into a ~5gb .vob .  I've tested it on a smaller on a smaller scale (1gb .vob to ~645mb)
    I am not quite sure how to do this with the whole tree I am left with, though, which looks similar to the following.
    $ ls ./NAME_OF_DVD/VIDEO_TS/
    VIDEO_TS.BUP VTS_01_0.IFO VTS_01_3.VOB VTS_02_0.BUP VTS_03_0.BUP VTS_04_0.IFO
    VIDEO_TS.IFO VTS_01_0.VOB VTS_01_4.VOB VTS_02_0.IFO VTS_03_0.IFO VTS_04_0.VOB
    VIDEO_TS.VOB VTS_01_1.VOB VTS_01_5.VOB VTS_02_1.VOB VTS_03_1.VOB VTS_04_1.VOB
    VTS_01_0.BUP VTS_01_2.VOB VTS_01_6.VOB VTS_02_2.VOB VTS_04_0.BUP
    EDIT:
    Stumbled across 'backlite' which is a qt based copy of k9copy.  Very promising from my first few impressions though I'm yet to thouroughly try this guy out.  Any thoughts from other's how may know about it?
    It would also be nice to learn how to effectively do this task from the comfort of a terminal.
    Last edited by akspecs (2012-04-17 17:25:46)

    OWC has nice options for both optical and hard drives.
    http://www.macsales.com/
    They are a Mac-oriented vendor, so the products they sell work with Macs. On the hard drive side, they sell most of their enclosures as a "0 GB" kit, so you can find a good deal on the drive mechanism elsewhere, and get the exact make and model you want.
    As for USB versus FireWire, FireWire 800 will obviously be faster. However, if the drive is going to be used for something like Time Machine, where speed is not crucial, a less expensive USB 2.0 drive will be fine. My Time Machine drive is connected by USB 2.0.
    You can get a FireWire hub, but daisy-chaining should work fine. The few available FireWire 800 hubs are expensive at the moment.

  • I need help making a backup script

    I'm trying to create this full system backup script that I plan to run manually. I have some commands to compress and extract my root directory and everything in it, but they're not complete because there are a few other features I would like to have. The problem is that I have no idea how to implement these specific features, and my googling of bash scripting documentation only left me confused and at square 1. This is what I have so far (just commands I can run in the terminal):
    To compress:
    sudo tar -cpf ~/archive.tar.gz / --exclude=/proc
    To extract & restore:
    sudo tar -xpf /home/agi/archive.tar.gz -C /
    I want this script to:
    1. allows me to run as
    sh ~/.bin/backup.sh [directory to back up]
    What I mean is there should be some sort of parameter in the script so that when I run it, I can choose whatever directory I want to compress rather than just be limited to just /.
    2. puts finished .tar.gz in my home directory (I plan to transfer the archive to external media or online later; this gives me the freedom to not need to have a specific drive connected to run the script). I already have this in the commands, but I just wanted to point out that this is important.
    3. names finished .tar.gz DD-MM-YY-backup.tar.gz where DD is day, MM is month, YY is year.
    4. the "sudo" part works correctly. That is, the script, when run, asks for a password and can be granted root permissions (or is granted root permissions in some other way) so that I can back up all parts of my system without these sorts of errors.
    5. shows some sort of progress indicator. Either a progress bar, shows the tar program output, or something that gives me an indication that the script is working and perhaps how long it will take. This one is really optional, for as long as the process is working properly then I'm ok. But if it is possible and not ridiculously complicated or difficult, it would be very nice.

    What I mean is there should be some sort of parameter in the script so that when I run it, I can choose whatever directory I want to compress rather than just be limited to just /.
    On my backup script, I specify $* which should accept any arguments passed to the script.. ex: $ ./backup.sh /source/folder /source/folder2.
    in the script:
    #!/bin/sh
    tar -cpf $HOME/$(date +%d%m%Y)-backup.tar.gz $* --exclude=/proc
    2. puts finished .tar.gz in my home directory (I plan to transfer the archive to external media or online later; this gives me the freedom to not need to have a specific drive connected to run the script). I already have this in the commands, but I just wanted to point out that this is important.
    In the above script, that is what the ~ or $HOME should do..
    3. names finished .tar.gz DD-MM-YY-backup.tar.gz where DD is day, MM is month, YY is year.
    Same thing, the above script should do the trick, you might want to modify the date parameters (check the date manual)
    4. the "sudo" part works correctly. That is, the script, when run, asks for a password and can be granted root permissions (or is granted root permissions in some other way) so that I can back up all parts of my system without these sorts of errors.
    You could put something to prevent the script from running unless you are root, or you could have it prompt for a password and use sudo within the script. I would recommend the first. Here is a code snippet:
    #Check for root
    if [ $(whoami) != "root" ]; then
    echo "Error: You cannot perform this operation unless you are root"
    exit 1
    fi
    5. shows some sort of progress indicator. Either a progress bar, shows the tar program output, or something that gives me an indication that the script is working and perhaps how long it will take. This one is really optional, for as long as the process is working properly then I'm ok. But if it is possible and not ridiculously complicated or difficult, it would be very nice.
    You might be able to use a similar program to tar, but with progress. Maybe someone else could shed some light here..
    Hope this helps...

  • 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

  • Have you tried your iPhoto 5 DVD backups with iPhoto 6?

    Hi,
    Have you tried your iPhoto 5 DVD backups with iPhoto 6?
    When I upgraded to iPhoto 5 I had to rebuild all my previous iPhoto 4 backups to the new version. It took hours and I had to re-burn the DVDs in the new format.
    Thanks,
    -meny

    Hi Lori,
    I meant a CD or DVD burned from within iPhoto 5.
    If you made such CD/DVD in iPhoto 4 and opened it in iPhoto 5, the library had to be rebuilt. This took up to 15 minutes.
    If iPhoto 6 can open iPhoto 5 libraries without a need to rebuild, that's great news!
    -meny

  • Install & Backup Scripts - 1st try at scripting

    Here is my first real attempt at bash scripting.  The first is a simple script to back up some of my files and configs everytime my comp is shutdown:
    #!/bin/bash
    #Archive and compress files
    tar -czf /home/casey/ArchBoxBak.tar.gz /home/casey/.bashrc /home/casey/.conkyrc /home/casey/.xinitrc /home/casey/scripts /home/casey/.keytouch2 /home/casey/.config
    #Copy to Server
    scp /home/casey/ArchBoxBak.tar.gz [email protected]:/home/casey
    #Clean up
    rm /home/casey/ArchBoxBak.tar.gz
    The second is a semi-automated install script to be run after a fresh install from a cd:
    #!/bin/bash
    #Script to install programs and set themes
    #Must be run as root
    echo ; clear
    #Check that the user updated the kernel and restarted before proceeding
    echo -n "Have you already updated the kernel and restarted? (Y/n) "
    read Keypress1
    case "$Keypress1" in
    [Nn])
    pacman -S kernel26
    echo
    echo "Now please reboot and re-run this script. Exiting... "
    exit
    break
    esac
    #Install yaourt
    echo
    echo -n "Install Yaourt? (REQUIRED to continue) (Y/n) "
    read Keypress2
    case "$Keypress2" in
    [Nn])
    echo
    echo "This script cannot continue without Yaourt. Exiting... "
    exit
    echo
    echo >> /etc/pacman.conf
    echo "[archlinuxfr]" >> /etc/pacman.conf
    echo "#yaourt repo" >> /etc/pacman.conf
    echo "Server = http://repo.archlinux.fr/i686" >> /etc/pacman.conf
    esac
    echo
    echo -n "Verify the right archlinux.fr repo was added? (Y/n) "
    read Keypress3
    case "$Keypress3" in
    [Nn])
    break
    nano /etc/pacman.conf
    echo ; clear
    esac
    echo
    echo "Continuing to install Yaourt... "
    echo
    pacman -Sy
    pacman -S yaourt
    #Install powerpill
    echo "Powerpill is a wrapper for Pacman that increases the speed "
    echo "of package downloads by using aria2c as a download accelerator "
    echo "and is REQUIRED for this script to continue. "
    echo
    echo -n "Install Powerpill? (Y/n) "
    read Keypress4
    case "$Keypress4" in
    [Nn])
    echo
    echo "This script cannot continue without Powerpill. Exiting... "
    exit
    yaourt -S powerpill
    esac
    #Update packages installed from cd
    echo
    echo -n "Update ALL installed packages? (Y/n) "
    read Keypress4a
    case "$Keypress4a" in
    [Nn])
    break
    powerpill -Syu
    esac
    #Install user defined programs
    echo
    echo -n "Install extra programs? (Y/n) "
    read Keypress5
    case "$Keypress5" in
    [Nn])
    break
    pacman -S xorg
    powerpill -S openbox obconf obmenu firefox gstreamer0.10-ffmpeg 0.10.4-1 flashplugin gstreamer0.10-ffmpeg gstreamer0.10-ugly-plugins medit thunar sakura xmms meld gimp gpicview feh pidgin xmms vlc abiword galculator gnumeric xpdf obconf aspell-en conky gpicview scrot openbox-themes
    yaourt -S phatch
    esac
    #Install extra fonts
    echo
    echo -n "Install additional fonts? (Y/n) "
    read Keypress6
    case "$Keypress6" in
    [Nn])
    break
    powerpill -S ttf-bitstream-vera ttf-dejavu ttf-ms-fonts
    esac
    echo
    echo "All programs and packages are updated and installed. "
    #Import config files
    echo
    echo -n "Import configuration file backups? (Y/n) "
    read Keypress7
    case "$Keypress7" in
    [Nn])
    echo
    echo "This script is complete. Exiting... "
    exit
    ping 192.168.1.200 -c 1 > /dev/null #2>&1
    if [ $? -eq 0 ] ; then
    echo
    echo "Connecting to server... "
    else
    echo
    echo "The server was not found at 192.168.1.200. "
    echo "Please re-run script when server is connected "
    echo "or set configurations manually. Exiting... "
    exit
    fi
    esac
    echo "Downloading ArchBoxBak.tar.gz... "
    scp [email protected]:ArchBoxBak.tar.gz /
    echo
    echo -n "Install config files automatically? (Y/n) "
    read Keypress8
    case "$Keypress8" in
    [Nn])
    echo
    echo "This script is complete. Exiting... "
    exit
    echo "Extracting ArchBoxBak.tar.gz... "
    tar -xzf /ArchBoxBak.tar.gz
    esac
    echo
    echo "Please verify the files were extracted correctly. "
    echo "Use <ctrl><alt><f2-f7> to open a new console. "
    echo "Press any key to continue. "
    read Keypress9
    case "$Keypress9" in
    break
    esac
    echo
    echo -n "Remove ArchBoxBak.tar.gz? (Y/n)"
    read Keypress10
    case "$Keypress10" in
    [Nn])
    break
    rm /ArchBoxBaks.tar.gz
    esac
    echo
    echo "This install is complete."
    exit
    Please, if you feel so inclined, take a look and give some feedback.  Both scripts are working but I do have an appreciation for doing things the "right" way, so if you see something that could be improved let me know.  I think the next step will be to ask for inputs for file name, location, things like that so that it will be usable for anyone.
    -monstermudder78

    fukawi2 wrote:
    Make the backup script shorter, faster and save having the temporary holding file...
    #!/bin/bash
    tar cvzf - /home/casey/.bashrc /home/casey/.conkyrc /home/casey/.xinitrc /home/casey/scripts /home/casey/.keytouch2 /home/casey/.config | ssh [email protected] 'cat - > /home/casey/ArchBoxBak.tar.gz'
    Just a note - in your original script, you're calling tar with the cvf options, (ie, without the z option), but you're naming the file with a .gz extension. Either use the 'z' option to compress it, or just name it .tar extension
    I think either I am not understanding something or you might have missed it, but in my post I think I am using 'z':
    #!/bin/bash
    tar cvzf - /home/casey/.bashrc
    fukawi2 wrote:
    Also, IMHO, it's good to use variables and absolute paths. Personally, I'd expand the script to something like this:
    #!/bin/bash
    USERNAME='casey'
    SERVER='192.168.1.200'
    SERVER_FILE='/home/casey/ArchBoxBak.tar.gz'
    TAR='/bin/tar'
    SSH='/usr/bin/ssh'
    $TAR cvzf - /home/casey/.bashrc /home/casey/.conkyrc /home/casey/.xinitrc /home/casey/scripts /home/casey/.keytouch2 /home/casey/.config | $SSH ${USERNAME}@${SERVER} "cat - > ${SERVER_FILE}"
    Doesn't really offer any great advantages in this instance (unless the PATH var isn't set properly at run time), but if you expanded the script out to do multiple things with the file on the server (chmod for example), then using the variables means you only have to update it in one place if you want to change the filename in the future.
    Thanks for the pointer.  This was an idea that crossed my mind but I didn't know how to do it easily and then I moved on.
    fukawi2 wrote:Overall, pretty good for a first shot
    Thanks for taking the time to look it over

  • How do i create a backup script

    please how do i create a backup script to run full backup

    user9106453 wrote:
    please how do i create a backup script to run full backupIs there a reason that you don't want to use the one provided with the installation ?

Maybe you are looking for

  • No SAP Datasources or SAP Toolbar in Crystal Reports 2008

    I cannot see the SAP toolbar or SAP datasources under "Create New Connection" in Crystal Reports 2008 SP1. After reading many threads on SDN and reistalling Crystal Reports 2008 SP1 and the BOBJ SAP Integration Kit many times I have not been able to

  • Converting a PDF to an EPUB using InDesign

    I have four finished books in PDF files, totaling 1857 pages including over 600 photographs, which I need to convert to EPUB files in InDesign.  I used a script to import all of the pages of one book into InDesign into a document reflecting the page

  • Help Oracle 10g+PHP and Bengali language support !!!!

    Hi All: i have a emp having a column names namewhich is of nvarchar2 datatype. What I want is to insert a value from a html from which will insert Bengali language as my input to the name filed in my database and show me the same on the browser when

  • Importing problems, HD from DV tape

    Hello! So I filmed on Canon Vixia, and then a Sony Handycam HDR-FX1000. Both instances I chose the HD record setting, and it was recorded onto a DV tape. Ive done it once before with the vixia, and couldnt get Final Cut Pro to recognize the footage o

  • SC limit item currency change

    Hello, After creating the SC with limit items, in the soco we create a held PO so that we could change the vendor. Say SC with 9000 quantity price 1 SEK. 1. In the held PO for the user is changing the currency to EUR and reducing the corresponding qu