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

Similar Messages

  • 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

  • Help Needed With a Backup Script

    I am writing a DNS server backup script with additional options. 
    Backing Up DNS Server Daily
    Create a folder based on current date
    Copy the backup from source to newly created folder based on date
    Complicated part (well, for me anyway :) )
    keeping current month's backup (30 different copies/Folder of backup for each day)
    Create a folder every calender month and and copy all 30 copies of backups within this folder
    Email Results of copying process either success or failed
    So Far i have the following which covers half of what is required! 
    $date = Get-Date -Format yyyyMMdd
    New-Item C:\dnsbk\DNSBackup$date -ItemType Directory
    $1st = Export-DnsServerZone -Name test.ac.uk -Filename backup\test.ac.uk.bk
    $2nd = Export-DnsServerZone -Name _msdcs.test.ac.uk -FileName backup\_msdcs.test.ac.uk.bk
    $source = "C:\windows\system32\dns\*"
    $destination = "C:\dnsbk\DNSBackup$date"
    $copy = Copy-Item -Recurse $source $destination
    $successSubject = "Backup Completed Successfully"
    $SuccessBody = "$1st,$2nd,$copy" <<<<<< This does not work >>>>>
    Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject $successSubject -SmtpServer 192.168.0.1 -Body $SuccessBody

    Hi IM3th0,
    If you want to confirm whether the copy operation run successfully and pass the result to the variable $SuccessBody, please try the script below:
    $copy = Copy-Item -Recurse $source $destination -PassThru -ErrorAction silentlyContinue
    if ($copy) { $SuccessBody="copy success" }
    else { $SuccessBody="Copy failure"}
    Reference from:
    how to capture 'copy-item' output
    If you want to remove the other 29 copies and keep the lastest one, please filter the 29 copies based on lastwritetime:
    $CLEANUP = (Get-DATE).AddDays(-30)
    $CLEANUP1 = (Get-DATE).AddDays(-1)
    Get-ChildItem | %{
    if($_.lastwritetime -gt $CLEANUP -and $_.lastwritetime -lt $CLEANUP1){
    Remove-Item $_.fullname -whatif}
    If I have any misunderstanding, please let me know.
    I hope this helps.

  • OS install in guest  ldom fails on install-begin script

    Hello,
    I am installing solaris 10 u4 on guest ldom using DVD media loaded in the physical server. The guest ldom was able to boot from DVD media and goes through installation steps where I input the hostname, ip, etc upto the section where the install script prompts for "Remote Services Enabled". After this section, the installation drops to # prompt.
    System identification complete.
    /sbin/install-begin: test: argument expected
    Exiting to shell.
    When I do "cat /sbin/install-begin", this script shows incomplete. Earlier I checked the script in primary ldom under /cdrom/cdrom0/s1/sbin, and it looked ok and I am using the same DVD media which was used to build the base OS.
    # cat /sbin/install-begin
    #!/bin/sh
    # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
    # Use is subject to license terms.
    #ident "@(#)install-begin.sh 1.4 06/03/10 SMI"
    # RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the Government
    # is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the
    # Rights in Technical Data and Computer Software clause at DFARS 52.227-7013
    # and in similar clauses in the FAR and NASA FAR Supplement.
    # NOTE: At this point on non-Intel systems, the locale has
    # not yet been configured
    # NOTE: This script may be called from outside the window
    # system (boot with "nowin" or kdmconfig/prtconf
    # configuration failed) or within the window system
    . /sbin/install-common
    if install_debug_isset scripts ; then
    ===========================================
    Not sure why the /sbin/install-begin script is not getting copied completly. Please let me if you have any input on this issue. I am planning to try with different DVD image to see if that helps.
    Thanks for your help !!.

    Thanks for your reply. Is there any fix for 6747687, I didnt see any in sunsolve. Here is the output from cdrw -Mv, the DVD I am using is the standard Sun DVD media.
    # cdrw -Mv
    Device : TSSTcorp CD/DVDW TS-T632A
    Firmware : Rev. SR03 ()
    Track No. |Type |Start address
    1 |Data |0
    Leadout |Data |1701760
    Last session start address: 0
    ======================
    Here is the df -k output from where it drops to shell prompt during install.
    # df -k
    Filesystem kbytes used avail capacity Mounted on
    /virtual-devices@100/channel-devices@200/disk@3:b 174639 157917 0 100% /
    /devices 0 0 0 0% /devices
    ctfs 0 0 0 0% /system/contract
    proc 0 0 0 0% /proc
    mnttab 0 0 0 0% /etc/mnttab
    swap 11498224 352 11497872 1% /etc/svc/volatile
    objfs 0 0 0 0% /system/object
    swap 11742576 244704 11497872 3% /tmp
    /tmp/dev 11742576 244704 11497872 3% /dev
    fd 0 0 0 0% /dev/fd
    /devices/virtual-devices@100/channel-devices@200/disk@3:a 3210366 3210366 0 100% /cdrom
    /cdrom/Solaris_10/Tools/Boot/usr 3210366 3210366 0 100% /usr
    /platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr/libc_psr_hwcap1.so.1 174639 157917 0 100% /platform/sun4v/lib/libc_psr.so.1
    /platform/SUNW,SPARC-Enterprise-T5220/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1 174639 157917 0 100% /platform/sun4v/lib/sparcv9/libc_psr.so.1
    swap 11497880 8 11497872 1% /tmp/root/var/run

  • 1607:Unable to install InstallShield scripting runtime

    I can't install iTunes, I get the error message saying:
    1607:Unable to install InstallShield scripting runtime.
    Need help... PLEASEEEEEEEEEE!!!!!!

    Hi iFriend,
    try this, it worked for me:
    1) first of all, uninstall QuickTime and older versions of iTunes from your PC, using the "remove" button in the "install applications" tool that you find in the windows control panel.
    2) reboot the system
    3) turn off the windows firewall application; go into the windows control panel, double click on windows firewall and disable the firewall option
    4) if you have one, disable your Anti-Virus application; i mean its real-time protection.
    5) probably it's not necessary, but for being sure... download and launch the standalone installer of QuickTime (latest version)
    6) download and launch the iTunes + QuickTime installer from this web address
    7) as an option, i suggest you to download and install also iTunes Art Importer. It's a nice application, that allows you to import from the internet directly into iTunes the album ArtWorks of the selected tracks in iTunes. I installed it, and it works very well with iTunes 6.
    8) after all the installations, remember to enable both firewall and anti-virus previously disabled!
    as i said, probably the 5th passage is not necessary, but i did it and it worked!
    if you have any questions or feedbacks, just relpy to this topic. stay iTuned!
    bye, bye,
    Marco

  • RMAN Backup Script not running in cron tab

    Hi,
    I am having rman backup script which is being executed successfully through shell.
    but when scheduled in cron the script is being called but RMAN commands are not getting executed.
    i have scheduled cron using oracle user.
    Attached below the rman script for taking LEVEL 1 backup
    #! /bin/ksh
    DATE=`date +%Y-%m-%d`
    export ORACLE_SID=ACIDC
    export ORACLE_BASE='/home/app/oracle/product/10.2.0'
    PATH=$PATH:${ORACLE_HOME}/bin
    export PATH
    export ULIMIT=unlimited
    export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib
    export LIBPATH=$LD_LIBRARY_PATH:/usr/lib
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    cd $ORACLE_HOME/bin
    rman TARGET= / << EOF > /oraclebkp/rmanlogs/ACIDC/$DATE.log
    backup incremental level 1 database;
    report obsolete;
    delete noprompt obsolete;
    exit;
    EOF
    exit 0
    Attached cron script
    SHELL=/bin/sh
    PATH=:/usr/ucb:/bin:/usr/bin
    10 17 * * 2 /oraclebkp/rmanscripts/rmandclvl1.sh 2>&1 >/oraclebkp/cronlogs/delobs.log
    Files delobs.log
    and oraclebkp/rmanlogs/ACIDC/$DATE.log are being created but with 0 bytes .
    Thanks in Advance
    HariPriya,

    rman TARGET= / << EOF > /oraclebkp/rmanlogs/ACIDC/$DATE.log Change this line to and try..
    $ORACLE_HOME/bin/rman TARGET= / << EOF > /oraclebkp/rmanlogs/ACIDC/$DATE.log

  • "1607: Unable to install InstallShiled Scripting Runtime"

    i had iTunes 5 for awhile because the newer version had bugs in it. I tried to update to iTunes 6 and installation froze while downloading the Quicktime portion. I tried installing iTunes 6 again but the error "1607: Unable to install InstallShiled Scripting Runtime" came up. I tried to uninstall iTunes completely but i could not find it on add/remove programs. Now I cant use iTunes or update my iPod.

    hi indolence!
    "iTunes cannot run because some of its required files are missing. Please reinstall iTunes."
    ouch. by any chance did you do a System restore "over top" of the date of a fresh itunes install, without uninstalling itunes/QT first? that's a known cause of that error message ... what the system restore does is strip out some of the installation registry entries for the recent install. here's a good reference on what system restore does and doesn't do for you:
    (MS) Frequently Asked Questions Regarding System Restore in Windows XP
    it would probably also be a good idea to head to Windows update if you did a system restore, to make sure you're still thoroughly up to date in that regard. (the restore may have stripped out recent updates.)
    Microsoft Windows Update
    the "hang" during the QT install has sometimes been caused by having Cygwin running during the install:
    iTunes 5 and QuickTime 7 for Windows: Installation won't work if Cygwin is running
    ... but other packages have also been implicated in this sort of thing. so prior to any installs, uninstalls or upgrades, it would be prudent in your case to switch off all background applications (including "terminate-and-stay-resident" applications):
    Close Applications Running in the Background
    to set up for the next attempt at an itunes install, it would be best to first uninstall your existing itunes/QT. use the complete uninstall instructions given here:
    Troubleshooting iTunes, iPod Software, and QuickTime installation on Windows
    if you run into trouble on the uninstall, try using the Windows Installer Cleanup utility:
    Description of the Windows Installer CleanUp Utility
    once you've got everything stripped out, try downloading and saving the itunes installer to your hard drive. (we'll run the install from there rather than online.)
    iTunes 6.0.1.3 Installer
    if you run into the the 1607, try the general and 1607-specific advice given in this document:
    Troubleshooting iTunes, iPod Software, and QuickTime installation on Windows
    ... and if the problem persists, try augmenting that advice with the InstallShield Tips and Pointers:
    InstallShield Consumer Central Frequently Asked Questions: Tips and Pointers
    keep us posted on your progress.
    love, b

  • Help installing itunes Scripts?

    hi all..
    Can anyone help me installing itunes scripts to help with bulk duplicates removal?
    Thanks,
    Brook

    hiya!
    When i click on itunes to install it, it says that there is insufficient space in the system drive to install it. also says it requires 100gb to do it.
    that's ultrakinky. itunes program file sizes total somewhere in the tens of megabytes ranges.
    let's try getting a installer log to the Discussions Hosts, so they can throw it over the fence so an Apple engineer can have a look at it.
    Start menu -> Run... In the text field of the dialog that comes up, type in "cmd" and hit return.
    In the command prompt dialog that comes up, find the iTunes installer on your desktop and drag it to this window. Then on the same line type in a space and then the following:
    /Verbose"c:\log.txt" /V"ENABLE_QTLOGGING=TRUE"
    There is no space between the e in Verbose and the double quote ("). There is no space between the V"Enable...
    Hit return.
    The installer will create two log files:
    C:\log.txt and C:\qt.log
    Find those files and send them to a Discussions Host Put the URL to this discussion thread into the email, so that whoever gets it has some context. Let them know the version of itunes you’re trying to install, too … in general, give as much info as you can.
    love, b

  • RMAN weekly full backup and daily incremental backup script.

    Hallo! I would like to implement an Oracle 10g database backup policy where every Sunday night at 10 pm, a hot full compressed database backup is done, for every other day i.e. Monday to Saturday, a daily incremental compressed backup is done also at 10 pm.
    If anyone as an RMAN script that can perform such a backup, please provide me with it.
    Thanks.

    4joey1 wrote:
    Hallo! I would like to implement an Oracle 10g database backup policy where every Sunday night at 10 pm, a hot full compressed database backup is done, for every other day i.e. Monday to Saturday, a daily incremental compressed backup is done also at 10 pm.
    If anyone as an RMAN script that can perform such a backup, please provide me with it.
    Thanks.I would suggest you to try it by your own
    Use DBMS_SCHEDULER or cron job (I hope you're using Linux) to create a schedule which invokes rman script to take backup you want
    Try it and we'll help you
    "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime"
    Kamran Agayev A.
    Oracle ACE
    My Oracle Video Tutorials - http://kamranagayev.wordpress.com/oracle-video-tutorials/

  • How to install post script fonts in lion?

    how do I install post script fonts in lion?

    "Font Manager". What do you like best?
    In my opinion, the only two worth considering are Suitcase Fusion 3, or FontExplorerX Pro.
    You're correct. Can you tell me more about "resource fork"
    All Mac files have two parts. A data fork, and a resource fork. Also known as A and B. To make that easier to understand, DOS/Windows only has a data fork for each file or folder. All information is written into one location for that item. Macs have two separate file data parts for each file or folder. Normally, the data is in the data fork (the main body of an image, Word document, etc.). The resource fork is normally used for the desktop icon, file and creation dates, and other simpler metadata.
    However, Type 1 fonts and older Mac legacy TrueType fonts had pretty much everything in the resource fork, including the font's binary data. So if the resource fork gets stripped, you end up with nothing left but a file name. As a related example, Apple's .dfont stands for "Data Fork Font". With the now rather obvious meaning the the font's binary data in is the data fork instead of the resource fork.
    An easy way around the problem is to take a Mac formatted flash drive and copy the fonts onto that drive directly from the Mac the fonts are on. Then copy them onto the new Mac from the flash drive.

  • 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

Maybe you are looking for

  • APPLE TV second generation stetting - home sharing / itunes not working

    I am sorry my message will be long but i will give all details to make sure someone can help me. AS i am fully lost in trying to resolve my problem. I have APPLE TV 2nd Generation - Wifi work fine i can watch youtube etc.. but home sharing seems to n

  • Restore failed and now my 64gb ipod touch wont turn on at all i tried so much stuff! help!

    Please help my Ipod touch 64gb 3rd gen failed to restore and now its stuck off! I can't turn it on at all i tried so much stuff and it won't just turn on. I keep trying but it stays off, no apple sign or ipod to itunes screen. Please help i need this

  • MIGO - Item Overview Field Columns

    Dear all, I've an issue on my company's Dev system whereby in the standard MIGO transaction screen, the Item Overview section (the middle table) seems to be missing columns starting from "Material Short Text" all the way until before "Text" column. M

  • HTTPS traffic redirection

    How can I redirect the https requests to my CE. Would it work's in transparent mode? Could anyone send me a sample config? Thanks!

  • H.264 Droplet producing poor results in Compressor 4

    I was happy to see my compressor droplet library updated with the new version icon but when I ran some tests the exact same settings (via droplet) produced noticeably different results. Compressor 4 is consistently distorting moving high contrast edg