Duplicate USB drive applescript/bash/automator

Basically i'm looking for a script that can be run whenever a usb drive is inserted. The script is to copy the contents of the usb (including the hidden files like .Trashes etc) and paste them into a folder on the desktop. It should also be able to accept any name of usb drive, basically i don't want to have to change the script each time a differently named usb is inserted. I've been looking up different scripts trying to understand it but just cannot figure out how to put different programs together to make the kind of script i need. Thanks

You can create a folder action for this with Automator. Press the Command ( ⌘)-Spacebar keys to open the Spotlight Search field, type the first couple letters of the app name (Aut), and press the Return key.
Press the Command ( ⌘)-N keys to open a new document and choose "Folder Action".
With the "Library" and "Actions" buttons selected, start typing "Copy Finder Items" in the search box until it is isolated in the Action list. Drag it into the Workflow pane.
Click "Choose folder" in the pop-up menu and click "Other...". Press the Shift-Command ( ⌘)-G keys. Type "/Volumes" and click the "Go" button. Click the "Choose" button. Choose where you want the Finder items to be saved to and whether they will be replacing existing files.
Press the Command ( ⌘)-S keys to reveal the Save dialog, enter a name for the folder action in the text input field, and click the Save button. The folder action becomes active upon save. Your folder action is saved to /Users/<username>/Library/Workflows/Applications/Folder Actions/.
The folder action you created will copy any volume mounted, not just USB volumes. As a result of this, and the fact that you may not want to copy all USB volumes, you need enable and disable control over the folder action. Press the Option-Command (⌘)-Spacebar keys to open a Finder window. Press the Shift-Command ( ⌘)-G keys. Type "/System/Library/CoreServices/Folder Actions Setup" and click the "Go" button.
Drag the "Folder Actions Setup" app icon either to the Dock or the Desktop to create an alias for easy access. If you want to place an alias in the Finder sidebar, hold down the Command (⌘) key while dragging it there.
Click the alias at any time to launch the app and open a window. To enable the folder action, select (checked) "Enable Folder Actions", "Volumes", and the workflow script you created. To disable, you can do so globally by deselecting (unchecked) "Enable Folder Actions", or individually by deselecting (unchecked) the workflow script. If you can't see your workflow, highlight "Volumes" first by clicking on it.
You may also want to create a keyboard shortcut to launch the Folder Actions Setup app. If you navigate to  > System Preferences > Keyboard > Shortcuts > Services, under "Files and Folders" in the selection field to the right, and scroll down, you'll see there is already a service for the app. Unfortunately, if you add a shortcut for the service it will only launch when in Finder. A better solution is to create a service that can launch the app from anywhere.
In Automator, open a new document and choose "Service".
At the top of the Workflow pane, click the pop-up menu to the right of "Service receives", scroll down to the bottom and click "no input". Ensure that "any application" is selected in the pop-up menu to the right. Drag the "Launch Application" action into the Workflow pane. Click on the pop-up menu within that action, scroll all the way to the bottom, and click "Other". Press the Shift-Command ( ⌘)-G keys. Type "/System/Library/CoreServices/Folder Actions Setup" and click the "Go" button. Click the "Choose" button.
Press the Command ( ⌘)-S keys to reveal the Save dialog, enter a name for the service in the text input field, and click the Save button. Your service is saved to /Users/<username>/Library/Services/.
Navigate to  > System Preferences > Keyboard > Shortcuts > Services, and under "General" at the bottom of the selection field to the right, click on "add shortcut" to enter a unique key combination. Use your shortcut any time you want to select or desert the folder action you created.
If you want to access your Automator service from the Menu bar, you can create an alias and place it in your Scripts Folder located at /Users/<username>/Library/Scripts/. Navigate to Script Editor > Preferences > General and select (checked) "Show Script menu in menu bar" if you don't see the Script menu in the Menu bar. You may want to deselect "Show Computer scripts".
The workflow will run any time you choose, copy the contents of any USB, including hidden files, and paste them into a same named folder on the Desktop. Note that some USB drives, with OS install files for instance, won't copy. Be aware that the workflow will copy every volume mounted, so remember to disable the folder action when you don't want to copy.

Similar Messages

  • Duplicate USB Drives With Automator or AS?

    Hello,
    I'm wondering if anyone knows of a way that I could connect several USB drives into a hub, have Automator copy certain files to each of them, then eject them (and maybe a notification from Growl would be nice. . . but not necessary ).  Does anyone here have an idea how to accomplish this?
    Thanks,
    Lawrence

    Ah, yeah, automator... a system to make the world easier by being painfully obtuse.  yeeee...
    try this.  copy the following into the AppleScript editor, modify it with the appropriate details, save it as a script, then attach it as a folder action to /Volumes (that I know you can do - this is just a pared-down version of my own folder action).
    property masterFolder : "hd:users:yourname:path:to:master folder"
    on adding folder items to thisFolder after receiving theseThings
              set workingVolumes to {}
              repeat with thisItem in theseThings
                        tell application "Finder"
                                  if kind of thisItem is "volume" and ejectable of thisItem is true then
                                            copy disk thisItem to end of workingVolumes
                                            set theFiles to every item of folder masterFolder
      duplicate theFiles to thisItem
                                  end if
                        end tell
              end repeat
      delay 10
      -- you could probably work out a more elegant way of testing whether the files are finished copying, but for now...
              tell application "Finder" to eject workingVolumes
    end adding folder items to
    Eventually you'll want to find a more precise specifier - this will copy the files to any ejectable drive you mount on the system that can be written to - but it's a start.

  • Automator to mount multiple ISO files on external USB drives

    I have several ISO files on an external USB drive on a Mac mini. Double clicking on any of the ISO mounts it, one at a time.
    I need to have an automator that mounts ALL ISO it can see on a given USB external drive. I have written an Apple script but that hangs up the Mac mini. I need help because I am not familiar with Applescript or Apple automator. I used Unix years ago, butg have a hard time with AppleScript.

    Macs can't normally write to NTFS drives:
    http://discussions.apple.com/click.jspa?searchID=7426620&messageID=4582486
    Your other problem sounds like another computer has the files open or application has the files open simultaneously. Try shutting down your Mac, and isolating your Mac from any network and try rebooting again in safe mode by holding the shift key at startup.

  • How Can You Create A Simple USB Driver

    Hello,
    I wonder if any one can help? I would like to try and build a simple USB driver for this devices http://www.maplin.co.uk/Module.aspx?ModuleNo=227123 I have no real experience programming for mac bar BASH scripts and a few AppleScripts. Could someone give me a few pointers to get started. The devices developer manual can be found here http://www.dreamcheeky.com/dream/forum/download/file.php?id=7
    Thank you,
    James

    http://developer.apple.com/referencelibrary/HardwareDrivers/idxUSB-date.html

  • Block all USB drives except ones owned by our company

    We am trying to setup a policy to block all USB Drives except the ones
    that are owned by the company
    Under USB Connectivity Control we have the following setup
    USB Devices: ENABLED
    Default Device Access: DISABLED
    Human Interface Devices (HID): Always ENABLE
    Mass Storage Class: DISABLE
    Printing Class: Always ENABLE
    Scanning/Imaging (PTP): DISABLE
    USB Device Access Settings
    Name Access Device Summary
    CompanyUSB1 ENABLE Serial Number=xxxxxxxxxxxx
    up to 30 more...
    BUT all USBs are able to connect, not just the ones we have defined in
    the USB Device Access Settings
    Can anyone let us know what we are doing wrong?

    OES2,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • Portable app on several usb drives

    I have created a working portable ZAV app on a USB drive. I've tried
    various ways of copying the "master" usb drive to other drives.
    I have also tried a drive image program. However when I try to use any of
    the other usb drives my app gives an error along the lines of the sandbox is
    corrupt.
    If I want the same app on a usb drive, do I really need to compile each one
    separately? Is there a simple way to duplicate the app on several usb
    drives?
    Tom

    Thomas,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • How to stop importing from usb drive going into root ITMS directory

    First time I imported, everything was fine. I was trying to get rid of some duplicates and got rid of one of the main subdirectories (I had "Itunes Music" folder with two main subdirectories, let's call them "Laptop" and "Desktop." I noticed I had many duplicate artists from these, so I deleted the "Laptop" directory. Naturally, all these showed up with asterisks on iTunes. With no easy way to delete them all (can't sort based on asterisk, apparently), I removed EVERYTHING from my Library and attempted to copy over from the USB drive again. This time, the contents of "Laptop" went into the root "iTunes Music" folder (so there were now ~50+ folders including the "Desktop."
    This isn't working for me, since my objective is to get rid of the duplicate work (duplicate tracks I can somewhat stomach, but I also have some duplicate "Artists" which is driving me crazy). I removed everything from the library, deleting it all (~30+GB) and deleted all of the subdirectories from the iTunes Music folder.
    When I went to reimport it all again. I dragged the "Laptop" folder from Finder on the USB drive into the iTunes Music directory again (as I did the first time), recreated the and everything continues to populate the top iTunes music folder. Is there any way to stop this? I want the "Laptop" folder to stay in it's subdirectory structure distinct and separate from the "Desktop" folder so I can ensure I am not unnecessarily increasing my structure.
    One easy (though extremely tedious) alternative could be to import the folders one at a time... but I'd really like to avoid that. But for my first mistake, this wouldn't have been an issue. I haven't changed any settings on iTunes, so please advise!

    I have duplicate (different) stuff on the laptop versus desktop but some unique to each (and all kinda scrambled up). I first started importing on my old G3 ibook. It was slower and chugged harder and some are at really low bitrate, for example, and also lack album art. My XP desktop was made for gaming and is much more powerful, so I always did high bitrate and was much more careful to do all the album art, etc.
    Now I'm trying to consolidate it all on my new MBP... Mostly, though, it's a mess and I've been putting this off for years and it's mostly my fault. My biggest gripe is the large number of duplicate tracks. I can live with these when they're from different albums (compilations mostly), but not when one is a lower bit. I imagine I'm gonna be doing it the hard way, one album/artist at a time...

  • [SOLVED]Mounting usb drives "not authorized" with thunar-volman (XFCE)

    Hi,
    I'm new to Arch (even though I must be approximately at my 15th try at installing it properly) and I have a problem with thunar-volman.
    Whenever I log in as user, and try to mount a usb drive with thunar, let's say I want to plug a drive labeled Ext3_8Go, I get the same message in a pop-up window : "Failed to mount Ext3_8Go (or anything close, not in English in the text), not authorized (that part is in English)"
    My install is :
    - net install
    - partitions : 9Go for /, no swap, no separate /home
    - packages : base and base-devel. The only modifications in the package list is that I remove ppp, pcmciautils, and xfsprogs.
    - config : at the install stage I only modify rc.conf to change LOCALE and HOSTNAME, and pacman's mirrorlist to allow all French mirrors in addition to the one at the top.
    When the usb installation is over, I run this script :
    "installation_xfce.sh"  (there may be some errors left, I modify this script as I learn) :
    #!/bin/bash
    # expected environment : freshly installed archlinux, login : root.
    echo "Are you connected to internet ? If not, please Ctrl+C and reload this script when connected"
    echo "Otherwise, press ENTER to continue installation"
    read var_dummy
    echo "Creation of the user : please type in your user name :"
    read var_username
    useradd -u 1000 -g users -G audio,lp,storage,optical,video,wheel,games,power,network -d /home/$var_username/ -s /bin/bash -m $var_username
    echo "You will now be asked to create the password for this user:"
    passwd $var_username
    # Add servers for pacman to find packages
    cat >> /etc/pacman.conf << EOF
    [multilib]
    Include = /etc/pacman.d/mirrorlist
    [archlinuxfr]
    Server = http://repo.archlinux.fr/\$arch
    [catalyst]
    Server = http://catalyst.apocalypsus.net/repo/catalyst/\$arch
    EOF
    # Install packages
    pacman -Syyu
    pacman -S acpi acpid alsa-oss alsa-plugins alsa-utils catalyst catalyst-utils cpufrequtils cups dbus gstreamer0.10-base-plugins iptables laptop-mode-tools mesa net-tools netcfg ntp pm-utils rfkill rsync sudo ttf-dejavu vim wireless_tools xf86-input-evdev xorg-server xorg-utils xorg-xinit xorg-xinput yaourt conky gamin gnome-icon-theme gnome-keyring gvfs-afc network-manager-applet networkmanager slim slim-themes archlinux-themes-slim hicolor-icon-theme xfce4 xfce4-goodies
    # If pacman failed, better stop the script here, and wait for a network connection
    if [[ $?!=0 ]]
    then
    echo : failed to install packages - check your network connection, or review script
    exit 1
    fi
    # Fix sound issue
    cat > /home/$var_username/.asoundrc << EOF
    pcm.!default{
    type hw
    card 1
    device 0
    ctl.!default{
    type hw
    card 1
    device 0
    EOF
    chown $var_username:users /home/$var_username/.asoundrc
    # Configure video settings for X to use Catalyst
    if [[ ! -e /etc/X11/xorg.conf.d ]]
    then
    mkdir /etc/X11/xorg.conf.d
    fi
    cat > /etc/X11/xorg.conf.d/20-fglrx.conf << EOF
    Section "Monitor"
    Identifier "aticonfig-Monitor[0]-0"
    Option "VendorName" "ATI Proprietary Driver"
    Option "ModelName" "Generic Autodetecting Monitor"
    Option "DPMS" "true"
    EndSection
    Section "Device"
    Identifier "aticonfig-Device[0]-0"
    Driver "fglrx"
    EndSection
    EOF
    sed -e 's/top_left/bottom_right/' -e '/alignment/i\double_buffer yes' -e '/CPU Usage/a\${color lightgrey}Temperatures:' -e '/CPU Usage/a\ CPU:$color ${hwmon 0 temp 1}°C' </etc/conky/conky.conf >/home/$var_username/.conkyrc
    chown $var_username:users /home/$var_username/.conkyrc
    # Install clickpad support
    yaourt -S xf86-input-synaptics-clickpad
    # Add french keyboard to X
    sed '/MatchIsKeyboard/a\\tOption "XkbLayout" "fr"' </etc/X11/xorg.conf.d/10-evdev.conf >/etc/X11/xorg.conf.d/10-evdev.conf.new
    mv -f /etc/X11/xorg.conf.d/10-evdev.conf.new /etc/X11/xorg.conf.d/10-evdev.conf
    # Add new daemons, remove old ones, disable hwclock and remove netfs since I don't use it. add it if you need it
    sed '/DAEMONS=/c\DAEMONS=(!hwclock dbus syslog-ng networkmanager laptop-mode acpid @alsa @cupsd @cpufrequtils ntpd crond)' </etc/rc.conf >/etc/rc.conf.new
    mv -f /etc/rc.conf.new /etc/rc.conf
    # Slim login manager ; change theme
    mv /usr/share/slim/themes/archlinux-darch-grey /tmp/
    mv /usr/share/slim/themes/default /tmp/
    rm -r /usr/share/slim/themes/*
    mv /tmp/archlinux-darch-grey /usr/share/slim/themes
    mv /tmp/default /usr/share/slim/themes
    sed '/^current_theme/c\current_theme archlinux-darch-grey' </etc/slim.conf >/etc/slim.conf
    # XFCE login, and thunar launched as a daemon
    sed '/^# exec/c\' </etc/skel/.xinitrc >/tmp/.xinitrc
    sed '/^# .../c\' </tmp/.xinitrc >/home/$var_username/.xinitrc
    cat >> /home/$var_username/.xinitrc << EOF
    exec ck-launch-session startxfce4
    thunar --daemon &
    EOF
    chown $var_username:users /home/$var_username/.xinitrc
    # Boot to runlevel 5 now, and run slim then
    sed -e 's/id:3/#id:3/' -e 's/#id:5/id:5/' -e 's|x:5:respawn:/usr/bin/xdm|#x:5:respawn:/usr/bin/xdm|' -e 's|#x:5:respawn:/usr/bin/slim|x:5:respawn:/usr/bin/slim|' </etc/inittab >/etc/inittab.new
    mv -f /etc/inittab.new /etc/inittab
    # Add colored prompt to user and root
    sed '/^PS1/c\' </etc/skel/.bashrc >/root/.bashrc
    cat >> /root/.bashrc << EOF
    PS1='\[\e[0;32m\]\u@\h\[\e[m\] \[\e[0;35m\]\w\[\e[m\] \[\e[m\] \[\e[0;32m\]\t -\[\e[m\] \[\e[1;31m\]\$ \[\e[m\] '
    EOF
    cp /root/.bashrc /home/$var_username/.bashrc
    chown $var_username:users /home/$var_username/.bashrc
    # How does one do that automatically ?
    # Manually add user to sudoers
    EDITOR="vim" visudo
    # Reboot, because it's quick and I'm too lazy to learn how to start all the daemons and others.
    reboot
    I can mount as a user, no password asked, with :
    udisks --mount /dev/sdb2
    but the GUI method tells me "not authorized".
    "groups user" outputs :
    lp wheel games network video audio optical storage power users
    the command "ck-list-sessions" outputs :
    Session2:
    unix-user = '1000'
    realname = ''
    seat = 'Seat1'
    session-type = ''
    active = TRUE
    x11-display = ':0.0'
    x11-display-device = '/dev/tty7'
    display-device = ''
    remote-host-name = ''
    is-local = TRUE
    on-since = '2011-08-15T08:56:03.716103Z'
    login-session-id = '1'
    Session1:
    unix-user = '1000'
    realname = ''
    seat = 'Seat2'
    session-type = ''
    active = FALSE
    x11-display = ':0.0'
    x11-display-device = ''
    display-device = ''
    remote-host-name = ''
    is-local = TRUE
    on-since = '2011-08-15T08:56:03.573029Z'
    login-session-id = '1'
    For those who don't have time to read the installation script, DBUS is in the DAEMONS list of rc.conf, and .xinitrc launches : exec ck-launch-session startxfce4
    Any idea ?
    Last edited by choubbi (2011-08-15 15:05:04)

    Thanks a lot !
    That worked !
    I stumbled across this part of the wiki several times before, but didn't really understand so I had not tried.
    If anyone's interested in the script, here's the corrected version :
    #!/bin/bash
    # expected environment : freshly installed archlinux, login : root.
    echo "Are you connected to internet ? If not, please Ctrl+C and reload this script when connected"
    echo "Otherwise, press ENTER to continue installation"
    read var_dummy
    echo "Creation of the user : please type in your user name :"
    read var_username
    useradd -u 1000 -g users -G audio,lp,storage,optical,video,wheel,games,power,network -d /home/$var_username/ -s /bin/bash -m $var_username
    echo "You will now be asked to create the password for this user:"
    passwd $var_username
    # Add servers for pacman to find packages
    cat >> /etc/pacman.conf << EOF
    [multilib]
    Include = /etc/pacman.d/mirrorlist
    [archlinuxfr]
    Server = http://repo.archlinux.fr/\$arch
    [catalyst]
    Server = http://catalyst.apocalypsus.net/repo/catalyst/\$arch
    EOF
    # Install packages
    pacman -Syyu
    pacman -S acpi acpid alsa-oss alsa-plugins alsa-utils catalyst catalyst-utils cpufrequtils cups dbus gstreamer0.10-base-plugins iptables laptop-mode-tools mesa net-tools netcfg ntp pm-utils rfkill rsync sudo ttf-dejavu vim wireless_tools xf86-input-evdev xorg-server xorg-utils xorg-xinit xorg-xinput yaourt conky gamin gnome-icon-theme gnome-keyring gvfs-afc network-manager-applet networkmanager slim slim-themes archlinux-themes-slim hicolor-icon-theme xfce4 xfce4-goodies
    # If pacman failed, better stop the script here, and wait for a network connection
    if [[ $?!=0 ]]
    then
    echo : failed to install packages - check your network connection, or review script
    exit 1
    fi
    # Fix sound issue
    cat > /home/$var_username/.asoundrc << EOF
    pcm.!default{
    type hw
    card 1
    device 0
    ctl.!default{
    type hw
    card 1
    device 0
    EOF
    chown $var_username:users /home/$var_username/.asoundrc
    # Configure video settings for X to use Catalyst
    if [[ ! -e /etc/X11/xorg.conf.d ]]
    then
    mkdir /etc/X11/xorg.conf.d
    fi
    cat > /etc/X11/xorg.conf.d/20-fglrx.conf << EOF
    Section "Monitor"
    Identifier "aticonfig-Monitor[0]-0"
    Option "VendorName" "ATI Proprietary Driver"
    Option "ModelName" "Generic Autodetecting Monitor"
    Option "DPMS" "true"
    EndSection
    Section "Device"
    Identifier "aticonfig-Device[0]-0"
    Driver "fglrx"
    EndSection
    EOF
    sed -e 's/top_left/bottom_right/' -e '/alignment/i\double_buffer yes' -e '/CPU Usage/a\${color lightgrey}Temperatures:' -e '/CPU Usage/a\ CPU:$color ${hwmon 0 temp 1}°C' </etc/conky/conky.conf >/home/$var_username/.conkyrc
    chown $var_username:users /home/$var_username/.conkyrc
    # Install clickpad support
    yaourt -S xf86-input-synaptics-clickpad
    # Add french keyboard to X
    sed '/MatchIsKeyboard/a\\tOption "XkbLayout" "fr"' </etc/X11/xorg.conf.d/10-evdev.conf >/etc/X11/xorg.conf.d/10-evdev.conf.new
    mv -f /etc/X11/xorg.conf.d/10-evdev.conf.new /etc/X11/xorg.conf.d/10-evdev.conf
    # Add new daemons, remove old ones, disable hwclock and remove netfs since I don't use it. add it if you need it
    sed '/DAEMONS=/c\DAEMONS=(!hwclock dbus syslog-ng networkmanager laptop-mode acpid @alsa @cupsd @cpufrequtils ntpd crond)' </etc/rc.conf >/etc/rc.conf.new
    mv -f /etc/rc.conf.new /etc/rc.conf
    # Slim login manager ; change theme
    mv /usr/share/slim/themes/archlinux-darch-grey /tmp/
    mv /usr/share/slim/themes/default /tmp/
    rm -r /usr/share/slim/themes/*
    mv /tmp/archlinux-darch-grey /usr/share/slim/themes
    mv /tmp/default /usr/share/slim/themes
    sed '/^current_theme/c\current_theme archlinux-darch-grey' </etc/slim.conf >/etc/slim.conf
    # XFCE login, and thunar launched as a daemon (note that the part with 'if [ -d /etc/X11/xinit/xinitrc.d ]" is not present, to avoid mounting problems when logged as regular user)
    cat > /home/$var_username/.xinitrc << EOF
    #!/bin/sh
    # ~/.xinitrc
    # Executed by startx (run your window manager from here)
    exec ck-launch-session startxfce4
    thunar --daemon &
    EOF
    chown $var_username:users /home/$var_username/.xinitrc
    # Boot to runlevel 5 now, and run slim then
    sed -e 's/id:3/#id:3/' -e 's/#id:5/id:5/' -e 's|x:5:respawn:/usr/bin/xdm|#x:5:respawn:/usr/bin/xdm|' -e 's|#x:5:respawn:/usr/bin/slim|x:5:respawn:/usr/bin/slim|' </etc/inittab >/etc/inittab.new
    mv -f /etc/inittab.new /etc/inittab
    # Add colored prompt to user and root
    sed '/^PS1/c\' </etc/skel/.bashrc >/root/.bashrc
    cat >> /root/.bashrc << EOF
    PS1='\[\e[0;32m\]\u@\h\[\e[m\] \[\e[0;35m\]\w\[\e[m\] \[\e[m\] \[\e[0;32m\]\t -\[\e[m\] \[\e[1;31m\]\$ \[\e[m\] '
    EOF
    cp /root/.bashrc /home/$var_username/.bashrc
    chown $var_username:users /home/$var_username/.bashrc
    # How does one do that automatically ?
    # Manually add user to sudoers
    EDITOR="vim" visudo
    # Reboot, because it's quick and I'm too lazy to learn how to start all the daemons and others.
    reboot
    The important part of the script to solve the problem is :
    cat > /home/$var_username/.xinitrc << EOF
    #!/bin/sh
    # ~/.xinitrc
    # Executed by startx (run your window manager from here)
    exec ck-launch-session startxfce4
    thunar --daemon &
    EOF
    chown $var_username:users /home/$var_username/.xinitrc

  • How can I take music from an USB and transfer it to the iPod? It tells me use use itunes to sync but the music is on an USB drive. It had worked in the past. Tks

    How can I transfer music from an USB drive to the iPod. I can see the music and play it on the computer, but the iPod tells me to use iTunes to sync. The music is not on iTunes. It has worked in the past.....tks

    These are just playlists. The songs there are really not duplicates of the songs. They are just a different location for accessing them. Some playlists can be deleted, some cannot. Ones that are created by iTunes cannot be deleted. Ones that you create can be. The Recently Added and the 90's cannot.

  • I want to dual boot Windows 8 on my 20-inch, Mid 2007 iMac, from an external USB drive.

    I want to dual boot Windows 8 on my 20-inch, Mid 2007 iMac, from an external USB drive. The internal drive is completely dead, it doesn't even show up in Disk Utility.  I'm running 10.8.2 from the external drive.  When I start Boot Camp Assistant, at the Introduction page, when I press the continue button nothing happens.  Do I have to have internal drive to run Boot Camp Assistant?  Can anyone provide me with the steps to dual boot, with his setup?  Thanks in advance!

    Hi maczimillon,
    Only follow these steps, it works for my:
    Open "System Information" and note your "Boot ROM Version" (some like MBP51.007E.B06)
    Navigate to "Utilities" in Finder and open the package contents of -BootCampAssistant.app- with right click. Duplicate the "Info.plist" file to the Desktop e.g. and open that with Text Editor.
    You must locate the keys "DARequiredROMVersions"and "USBBootSupportedModels"
    Add new strings with the information of your machine under booth keys (step 1), always respect the format, such as: <string>MBP51.007E.B06</string> for the frist key and <string>MBP51</string> for the second key.
    Save changes and replace the original plist file (it may ask you to enter admin pass)
    If you proceeded correctly you will see the checkbox "Create a Windows 7 USB install disk" enabled in Boot Camp Assistant.
    Then you can follow the usual Boot Camp installation using your WIN8 DVD iso image . The assistant program will proceed resizing your disk partition and installing necessary drivers for your iMac.
    I strongly recomends you to use thirld party's bootloaders like rEFInd (rEFIt) because of the Apple SMC versions of some old machines should not be able to boot properly from external devices like USB drives.

  • How Can I Set an Application on a USB Drive to Automatically Open When the Drive is Inserted Into a Mac?

    The title pretty much says it all. But if you don't understand, here is an example of what I want to happen:
    When a USB drive is inserted onto my Mac, an application on it will open.
    How can I make this happen?

    I haven't tried it, but perhaps a Watched folder on the external drive & an Applescript?
    http://www.mactech.com/articles/mactech/Vol.20/20.07/FolderWatching/index.html
    Or perhaps just an Applescript to check for exist :USB Drive Name, then run application?

  • My business partner created our website on her personal computer, then downloaded it on a USB drive. I pluggeed in my drive, after I upgraded my MAC to Lion,and now only see the initial start up in 2009. HELP!

    I upgraded my computer to Lion recently and have been having major problems, Most importantly with managing my website on iweb.
    my website is managed from a USB Drive, since the original creation was made on an ex-partners computer.
    When I plugged the drive in today, the original set up of the website from 2009 comes up.

    In Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    To open your domain file in Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain.
    Just launch the application, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    OT

  • R&R Backup (Image) on two external USB drives

    Hi Forum,
    in the early BIOS state of my T500 and working with Vista I had to rebuild my system several times due to OS failures. For that reason I periodically run R&R and make images on an external USB drive.
    Since I'm traveling very much I always have the USB drive with the image with me. The drive contains one basic backup and some incremental backups up to level 25 (at the time being).
    Now my goal: in case of a theft or a failure of that USB drive, I want to keep a second image on another USB drive at home.
    Now my questions:
    1: Is it possible to make backups with R&R (basic and incremental) of one computer on several USB drives?
    In that case R&R must detect which incremental level is present on the USB drive and create the appropriate backup (management of the levels on the USB drive, not on the computer).
    Example: USB drive A contains one basic backup and some incremental backups to level 12 (consistent) - USB drive B contains one basic backup and some incremental backups to level 17 (consistent as well).
    2: If the answer to question 1 is "yes" - does R&R manage this automatically in the windows interface or is it necessary to use the DOS level (rrcmd.exe). Which switches are to be set?
    Many thanks for help
    Axel

    It is  a difficult question: the help file isn't entirely clear.
    Here is my recent experience: using R&R 4.21 I had backed up my machine to the internal drive + 1 external USB drive several times, so that there was the base back-up and several incrementals on both drives. I also had copied the base backup + earlier incrementals to DVDs using the advanced menu entry for that task, just to be on the safe side. And, using another program (the free version of Syncback by 2BrightSparks), I regularly duplicate documents + pictures to the USB drive, so I'm covered in 3 different ways on 2 types of external hardware.
    On one or two occasions I did an incremental backup on the internal drive only--but the next time I did an incremental with the external USB drive attached, the missed incrementals were synchronized onto the external drive.
    Now, 2 weeeks ago I decided to zap the main disk and rebuilt the OS + programs to have a "clean slate" for 2010. When I had finished reinstalling everything minus personal files, I made a base backup (the only choice offered) on the internal drive with the external drive attached. This effectively erased the existing earlier backups on the external drive and copied over the new base backup.
    So this synchronization only operates in one direction: the external USB drive's store of R&R backups is a replica of what is on the main internal drive.
    I strongly suggest trying this all out (i.e. missing an incremental backup on the external drive, then making sure it has catched up after the next incremental backup) after making an external copy on DVD of the R&R backups. In fact, if you have the nerve, the patience and the time (and the DVD backups!), you should also try a bare metal restore of the DVD backup (I did last year when I bought this machine and hadn't too many personal files on it-- R&R 4.21 does actually work!)
    sorry i can't be more specific, but my advice is to practice the "disaster recovery" at least once, early on, in order to be sure how it works if disaster does strike.

  • Automate trash delete on USB drive

    I would like to create an Automator service (or anything else that I can access by ctrl-clicking in Finder) to delete all trash contents from a USB drive.
    Can anyone advise me on how to achieve this? I've found Terminal instructions but you have to navigate to the right place and I'd really like to stay in the GUI for this one.
    (And while we're at it, what's a good resource to learn basic Unix commands for the Mac?)
    Thanks in advance!

    LingoJango wrote:
    (And while we're at it, what's a good resource to learn basic Unix commands for the Mac?)
    You can start here

  • How to: Usb drive and folder uptodate?

    Hey,
    always on the go, and i have a usb drive and i'm trying to keep my school files updated from one to another with the most current version of the files.
    trying to figured something out with Automator
    Thanks

    Automator, as you have probably figured out, does not have an action to specifically syncronize files found in two different locations.
    If you are only moving files one way at any one time then you can piece together the following actions to do the job:
    1) Find Finder Items (options for where to look and what to look for - multiple whose criteria are possible
    2) View Results - good idea for seeing what is going on with the various selections you might want to use in step 1
    3) Copy Finder Items - if you are copying to the Flashdisk you need to have it connected to select it in this step
    You should build two of these, one for the computer -> flashdisk and one for the flashdisk -> computer activities.
    Syncronizing both ways at the same time is much more problematic with Automator and if you are transferring files two directions within the same day I am not sure this set of actions will work.
    PowerBook 12"   Mac OS X (10.4.6)  

Maybe you are looking for

  • 4.6 strange display problem

    You can see in the image above that the display of the game is offsetted by some amount vertically. The white section is not supposed to be there. In fact the blue is meant to be flush with the bottom of the screen. This happened by making two change

  • Spry horizontal menu active area in ie

    Hello, please look at: http://www.ildw.com/web/ildwnew/template_ildw_2009.html the mouse has to be on top of the letter to activate the submenu, how can I change that? I want the hit area to be wider! this happens in ie7 not in firefox. let me give y

  • No shared catalog supported in Lightroom 3?

    Hi, I was using Lightroom 2 with a shared catalog on my mac. It was shared between me and my wife who login as different users. The catalog was simply put in directory where both users had full read & write access. I tried the the same with Lightroom

  • Blind tty since nvidia upgrade

    Since I have update nvidia package from 1.0.9631-1 to 1.0.9746-1, I have black ttys when X is started and then killing X does not make ttys reappear. ttys still work, but in a "blind" way, so I can type some commands but without seeing what I'm typin

  • Open in CS4 Fit to Screen, from Bridge

    Is there a way I can open a RAW file in  ACR, and when I Open Image in CS4, they always open as fit to screen? The default seems to be 33.33%? Windows XP and CS4. Bob