Setup advice for rsync, ssh keys and launchd - all for remote webserver backup

Hi There,
This is the first time I'm doing this and I have limited command line experience but I need to setup a automatic backup of our webservers.
rsync
I have 4x rsync commands that work when run from the command line manually - here is an example, they just pull files from a few directories:
sudo rsync -avzO -e ssh [email protected]:/backups/ /Volumes/ServerVolume/webserver-backups/DEV/mysql/
I had issues with writing the files locally when running the above so had to do it as root and also add -O (-avzO). But because I need to run these automaticlly, I'm worried that running them as root will require a password - is that correct?
Also, while I've setup ssh keys, I feel unsure this has been done correctly - how do I test this properly?
launchd
While I've set up cron jobs on the webserver (a mysql dump) I don't have any experience with launchd and feel a bit out of my depth after reading the pages here:
http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystem Startup/Chapters/ScheduledJobs.html
http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystem Startup/Chapters/CreatingLaunchdJobs.html#//apple_ref/doc/uid/TP40001762-104142
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/ man8/launchd.8.html#//apple_ref/doc/man/8/launchd
I'm guessing I need to:
Somehow make the rsync command a file that wil execute in Terminal - do I just put it in a file and give it a .sh extension?
Create a launchd Property List File that will run the script at certain times
Somehow register the Property List File with launchd so it runs
Or maybe I should just use Automator and iCal?
I did try getting automator to run the rsync commands in terminal from iCal (I just pasted the commands straight in and set automator to pass them as arguments) but it doesn't seem to launch terminal so if there are errors, I can't see what they are. Because they started though, I think my SSH keys are setup.
Maybe it would just be better to figure out what is wrong with rsync commands and the permissions and just make these all run unattented from iCal?
Any help or suggestions would be much appreciated.
Cheers
Ben

Hi There,
This is the first time I'm doing this and I have limited command line experience but I need to setup a automatic backup of our webservers.
rsync
I have 4x rsync commands that work when run from the command line manually - here is an example, they just pull files from a few directories:
sudo rsync -avzO -e ssh [email protected]:/backups/ /Volumes/ServerVolume/webserver-backups/DEV/mysql/
I had issues with writing the files locally when running the above so had to do it as root and also add -O (-avzO). But because I need to run these automaticlly, I'm worried that running them as root will require a password - is that correct?
Also, while I've setup ssh keys, I feel unsure this has been done correctly - how do I test this properly?
launchd
While I've set up cron jobs on the webserver (a mysql dump) I don't have any experience with launchd and feel a bit out of my depth after reading the pages here:
http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystem Startup/Chapters/ScheduledJobs.html
http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystem Startup/Chapters/CreatingLaunchdJobs.html#//apple_ref/doc/uid/TP40001762-104142
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/ man8/launchd.8.html#//apple_ref/doc/man/8/launchd
I'm guessing I need to:
Somehow make the rsync command a file that wil execute in Terminal - do I just put it in a file and give it a .sh extension?
Create a launchd Property List File that will run the script at certain times
Somehow register the Property List File with launchd so it runs
Or maybe I should just use Automator and iCal?
I did try getting automator to run the rsync commands in terminal from iCal (I just pasted the commands straight in and set automator to pass them as arguments) but it doesn't seem to launch terminal so if there are errors, I can't see what they are. Because they started though, I think my SSH keys are setup.
Maybe it would just be better to figure out what is wrong with rsync commands and the permissions and just make these all run unattented from iCal?
Any help or suggestions would be much appreciated.
Cheers
Ben

Similar Messages

  • On my Macbook pro 15 2011, System Profiler is suggesting that it uses SATA III for the hard drive and SATA II for the Optical Drive.  Is that true?

    On my Macbook pro 15, 2011, System Profiler is suggesting that it uses SATA III for the hard drive and SATA II for the Optical Drive.  Is that true?

    That is correct. The tech specs indicate:
    Hard Drive Interface
    6.0 Gbps Serial ATA (SATA)
    Optical Drive Interface
    3.0 or 6.0 Gbps Serial ATA (SATA)

  • HT2305 I have forget my 4 digit passcode for my ipad 3 and exhausted all the attempts, Now the screen shows "ipad is disabled connect to itunes" How can I unlock my ipad now. Also I have not put "Find my iphone" in icloud as well. Please guide me to unloc

    I have forget my 4 digit passcode for my ipad 3 and exhausted all the attempts, Now the screen shows "ipad is disabled connect to itunes" How can I unlock my ipad now. Also I have not put "Find my iphone" in icloud as well. Please guide me to unlock it.

    Also when I am trying to connect ipad to my windows PC, it shows, your software is up to date and later starts restoring while updating again. Then automatically it stops to update halfway and I have to repeat the process again and again, still in vain.

  • Differences between Oracle 8i for a UNIX Platform and Oracle 8i for a Linux Platform

    Hello,
    J would like to know if there are some differences between Oracle 8i for a UNIX Platform and Oracle 8i for a Linux Platform.
    I know that there are some differences on Oracle 8i Parallel Server and i know that some products are not include like precompiler (Mod*Ada, Pro*FORTRAN) on a Linux Platform.
    Thank you.

    We have installed Oracle 8i on Solaris 8 and it had a great performance, of course that the hardware and licence invested here was costed my the office where i work. Personaly i'd installed linux reh hat 8 and oracle 8i, imagine that, it could be implemented by any individual that has the time to do so.
    By buyinng from a company that has a good background you could be sure that you will have support.
    Bottom line, if you have the $ to buy great hardware go for a unix platform. But if you don't a Red Hat Linux Server Licence with a 1 year sopport and Oracle data base is about 3500Dls.
    Visit www.red-hat.com
    Rewards... Bye

  • I am having a lot of trouble downloading itunes.My latest error message is that MediaToolbox.dll is missing. I have been trying to fix this for three days now .And it all started with the last update .Can anyone help?

    I am having a lot of trouble downloading itunes.My latest error message is that MediaToolbox.dll is missing. I have been trying to fix this for three days now .And it all started with the last update .Can anyone help?

    Taken at face value, you're having trouble with an Apple Application Support program file there. (Apple Application Support is where single copies of program files used by multiple different Apple programs are kept.)
    Let's try something relatively simple first. Restart the PC. If you're using Vista or 7, now head into your Uninstall a program control panel, select "Apple Application Support" and then click "Repair". If you're using XP, head into your Add or Remove Programs control panel, select "Apple Application Support", click "Change" and then click "Repair".
    If no joy after that, try the more rigorous uninstall/reinstall procedure from the following post. (If you've got XP, although the procedure is for Vista and 7, just read "Computer" as "My Computer", read "Uninstall a program control panel" as "Add or Remove programs control panel" and assume the system is 32-bit, and you'll be doing the right things.)
    Re: I recently updated to vista service pack 2 and I updated to itunes 10.2.1 and ever

  • TS3297 I connected my new iphone to my computer for the first time and lost all my contacts.  any way to get them back

    I connected my new iphone to my computer for the first time and lost all my contacts.  any way to get them back

    Did you have them stored in iCloud?

  • Hello,  Can you please advise me as to the recommended system requirements for Adobe CC for Photoshop, Illustrator, InDesign, and Dreamweaver (all 4 programs). I'm hoping this is summarized somewhere rather than making me look up and compare all four. I'l

    Hello,
    Can you please advise me as to the recommended system requirements for Adobe CC for Photoshop, Illustrator, InDesign, and Dreamweaver (all 4 programs). I'm hoping this is summarized somewhere rather than making me look up and compare all four. I'll be using a windows based PC, and will need a graphics card that can support at least two monitors.

    Hi julir
    check this System requirements | Photoshop
    why photoshop demand?cause photoshop having 3D feature, it mean need high spec,,so if you can run photoshop cc to run ai,indd and dw is posibilty
    regards
    Deto

  • Filters for Blown out camera and color shots for CS5

    What are some good filters to fix blown out camer and color shots in CS5?
    Thanks,

    Hi Bill, Here's the link the of the blown out footage. http://www.youtube.com/watch?v=4lxJJN2PgqM&feature=youtu.be
    Date: Wed, 18 Jul 2012 17:20:37 -0600
    From: [email protected]
    To: [email protected]
    Subject: Filters for Blown out camera and color shots for CS5
        Re: Filters for Blown out camera and color shots for CS5
        created by Bill Hunt in Premiere Pro CS5, CS5.5, & CS6 - View the full discussion
    Well, a few Effects, that might help - a little, would be Curves, Levels and Shadow & Highlight, along with the Three-way Color Corrector. However, the success will depend on the footage. Can you post a Vimeo, or YouTube example, as once one sees what you are working with, they may have other ideas. Good luck, and welcome to the forums, Hunt
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4566208#4566208
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4566208#4566208. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Premiere Pro CS5, CS5.5, & CS6 by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Cannot sign onto my aol account today through firefox.. it works for other browsers..and usually works for firefox

    cannot sign onto my aol account today through firefox.. it works for other browsers..and usually works for firefox

    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • TS2446 Hello!After I've done my last softwere update I couldn't buy or get any free apps on the apps store.There was an error on my paymant method.I reintrodius my data for the credit card and again error for my credit card.I've changed the credit card an

    Hello!After I've done my last softwere update I couldn't buy or get any free apps on the apps store.There was an error on my paymant method.I reintrodius my data for the credit card and again error for my credit card.I've changed the credit card and the same.why???????

    I have tried all those things I even updated the software to the new iOS system and it still did fix my problem.
    What happened is that my garage band looks like it will open then it shuts down.
    I have lot of important things on my garage band and I'm afraid that if I uninstall it deleting it then reinstalling it all my work on it will be gone and I can't have that happen.
    Everyday I am hoping that when i go to open the app that is will work but it doesn't it gets ready to turn on then it shuts off , the app doesn't even open all the way and turns off.
    I really hope I don't have to erase it.
    It'll say it's ,lading my songs then it shuts down .
    If I waited for the App Store to come up with an update for garage band should I wait till then to update my app so it doesn't get damaged . I don't want to erase it and all my data get erased . I figured if I wait for an update then my garage band will reset itself but won't delete my data. I'm not sure if that will help. Is there anything you or anyone else might know that can help me with this matter ?
    Thank you
    Simachyahi

  • I just synched for the first time, and lost all my apps. Help?

    I just sync'd my Iphone for the first time, and lost all my apps. Help?

    Ya that sucked, same thing happened to me, however i was looking for an excuse to clean up my phone, so i was not to angry when it happened. As for a remedy to the situation, i have no idea

  • I just bought a Macbook Air. I also have an external harddrive for which to transfer and save all my existing music from my PC. Will I have any troubles with iTunes recognizing where my music is located if I keep it on the external harddrive?

    I just bought a Macbook Air. I also have an external harddrive for which to transfer and save all my existing music from my PC. Will I have any troubles with iTunes recognizing where my music is located if I keep it on the external harddrive and not save it on the computer's harddrive?

    Just be sure to Follow the steps here to transfer your iTunes to an External Drive...
    Backup iTunes to an External Drive
    http://support.apple.com/kb/HT1751

  • DS 6.3 ssh key and password expiration warnings

    I suspect this may be more of an ssh issue than a DS issue, but has anyone managed a configuration that will give users logging in with ssh keys, password expiration or reset warnings?
    In my setup, using compat mode in nsswitch.conf, native ldap logins work as expected for users entering their password. - That is, they are forced to change the password after an admin reset, receive "your password will expire" warnings, based on the expiration period set in DS (password policies in DS 6 mode, migrated from DS 5.2), etc.
    If a user has an ssh authorized_key entry, they can login without a password, as long as their password is not expired, or been reset by an admin. They are never shown the warning messages, but are allowed to connect, and then immediately logged off, if their password has expired, passed the number of grace logins, or been reset.
    The user can only login if they start from a different username and bypass the ssh key check.
    Hope this makes sense.

    After running various debug modes, I'm beginning to believe that the Directory Server may only issue the warning messages if a password has been typed, and validated in the directory. Since no password is enered when using an ssh key, the warnings aren't triggered.

  • Ssh keys and gnupg keys from wiki instructions...

    following first the gnupg instructions and then ssh keys I've managed to get several instances of gpg-agent running.
    [root@frylock ~]# ps aux | grep agent
    root 2764 0.0 0.0 4208 432 ? Ss 11:15 0:00 ssh-agent
    xtian 2785 0.0 0.1 3500 972 ? Ss 11:18 0:00
    gpg-agent -s --enable-ssh-support --daemon
    --write-env-file /home/frylock/xtian/.gnupg/gpg-agent.env
    root 2958 0.0 0.0 3168 688 ? Ss 11:39 0:00
    gpg-agent -s --enable-ssh-support --daemon
    --write-env-file /root/.gnupg/gpg-agent.env
    root 3036 0.0 0.0 4740 392 ? Ss 11:43 0:00 gpg-agent --daemon
    root 3186 0.0 0.0 4740 388 ? Ss 11:53 0:00 gpg-agent --daemon
    root 3299 0.0 0.0 4740 388 ? Ss 11:58 0:00 gpg-agent --daemon
    root 3549 0.0 0.0 4740 392 ? Ss 12:54 0:00 gpg-agent --daemon
    This I can resolve by going back over the instructions--a fifth time. But what I don't understand, why my user account owner of a running process when I'm only logged in one tty as root?
    //EDIT: Clarify the login scenario
    // EDIT: the code block is cutting off line
    Last edited by xtian (2013-09-07 14:20:00)

    xtian wrote:
    cfr wrote:For example, I don't include the code in ~/.xinitrc or in /etc/profile.d precisely because I'm starting the agent somewhere else.
    That's just it. I'm not starting it somewhere else. According to the wiki, its being called from .xinitrc and that's where the call is made to the script in profile.d, I think. Unless the script in /etc/profile.d is starting the script automatically?? I don't know.
    Yes. The script you have in /etc/profile.d will start it automatically. I have a similar script in /etc/kde/env and that is all I use. I don't need anything in ~/.xinitrc (or kde's autostart stuff or whatever).  At least, this is true provided those scripts are sourced. What you definitely do not want is the line you currently have in ~/.xinitrc which does not check to see if an instance of gpg-agent is already running.
    This is what I use:
    $ cat /etc/kde/env/gpg-agent-startup.sh
    #!/bin/sh
    # see https://wiki.archlinux.org/index.php/SSH_Keys
    GPG_AGENT=/usr/bin/gpg-agent
    ## Run gpg-agent only if not already running, and available
    if [ -x "${GPG_AGENT}" ] ; then
    # check validity of GPG_SOCKET (in case of session crash)
    GPG_AGENT_INFO_FILE=${HOME}/.gpg-agent-info
    if [ -f "${GPG_AGENT_INFO_FILE}" ]; then
    GPG_AGENT_PID=`cat ${GPG_AGENT_INFO_FILE} | grep GPG_AGENT_INFO | cut -f2 -d:`
    GPG_PID_NAME=`cat /proc/${GPG_AGENT_PID}/comm`
    if [ ! "x${GPG_PID_NAME}" = "xgpg-agent" ]; then
    rm -f "${GPG_AGENT_INFO_FILE}" 2>&1 >/dev/null
    else
    GPG_SOCKET=`cat "${GPG_AGENT_INFO_FILE}" | grep GPG_AGENT_INFO | cut -f1 -d: | cut -f2 -d=`
    if ! test -S "${GPG_SOCKET}" -a -O "${GPG_SOCKET}" ; then
    rm -f "${GPG_AGENT_INFO_FILE}" 2>&1 >/dev/null
    fi
    fi
    unset GPG_AGENT_PID GPG_SOCKET GPG_PID_NAME SSH_AUTH_SOCK
    fi
    if [ -f "${GPG_AGENT_INFO_FILE}" ]; then
    eval "$(cat "${GPG_AGENT_INFO_FILE}")"
    eval "$(cut -d= -f 1 "${GPG_AGENT_INFO_FILE}" | xargs echo export)"
    export GPG_TTY=$(tty)
    else
    eval "$(${GPG_AGENT} -s --enable-ssh-support --daemon --pinentry-program /usr/bin/pinentry-qt4 --write-env-file)"
    fi
    fi
    In any case, your script should check for the environment file and only start an instance of the agent if it doesn't exist.
    I'ts not my script. I'm not up on BASH scripts. This one is from the wiki page. Isn't this script checking just that in this IF clause:
    if test -f "$envfile" && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then
    eval "$(cat "$envfile")"
    Yes. But the line you have in ~/.xinitrc does NOT check this. It just starts an instance of gpg-agent as a daemon.

  • Advice required on optimal MTU and MSS settings for GRE and IPSEC connections

    Hi,
    We have 2 remote sites (Site A and Site B) which connect to our datacentres (DC) over IPSEC VPN and connect to each other over GRE tunnels.
    We had some issues recently which we believe were MTU/MSS related (browsing web servers at one location not appearing correctly etc)
    We got some advice from our Cisco partner and tweaked some settings but I'm still not convinced we have the optimal configuration - and we still have some problems I suspect may be MTU related.  For example, from our DC (connected to Site A by IPSEC), we CANNOT browse to the webpage of the phone system hosted at Site A.  Yet, we CAN browse to the webpage of the Site A phone system from Site B (connected over GRE)
    Site A and Site B have two WAN internet circuits each - and each provider presents their circuit to us as ethernet.
    Here are the relevant interface settings showing the currently configured MTU and MSS (both routers are configured the same way)
    Can someone advise on what the optimal settings should be for our MTU and MSS values on the various interfaces or how we might best determine the values?
    interface Tunnel1
    description *** GRE Tunnel 1 to SiteB***
    ip address [removed]
    ip mtu 1400
    ip tcp adjust-mss 1360
    keepalive 30 3
    tunnel source [removed]
    tunnel destination [removed]
    interface Tunnel2
    description *** GRE Tunnel2 to SiteB***
    ip address [removed]
    ip mtu 1400
    ip tcp adjust-mss 1360
    keepalive 30 3
    tunnel source [removed]
    tunnel destination [removed]
    interface GigabitEthernet0/0
    description "WAN Connection to Provider1"
    ip address [removed]
    ip access-group firewall in
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip mtu 1492
    ip nat outside
    ip inspect cbac out
    ip virtual-reassembly in
    crypto map cryptomap
    interface GigabitEthernet0/1
    description "Connection to LAN"
    no ip address
    ip flow ingress
    ip flow egress
    duplex auto
    speed auto
    interface GigabitEthernet0/1.1
    description DATA VLAN
    encapsulation dot1Q 20
    ip address [removed]
    ip access-group 100 in
    ip nat inside
    ip virtual-reassembly in
    ip tcp adjust-mss 1320
    interface GigabitEthernet0/1.2
    description VOICE VLAN
    encapsulation dot1Q 25
    ip address [removed]
    ip nat inside
    ip virtual-reassembly in
    ip tcp adjust-mss 1320
    interface GigabitEthernet0/2
    description "Connection to Provider2"
    ip address [removed]
    ip access-group firewall in
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip mtu 1492
    ip nat outside
    ip inspect cbac out
    ip virtual-reassembly in
    duplex auto
    speed auto
    crypto map grecrypto
    Thanks.

    Disclaimer
    The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
    Liability Disclaimer
    In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
    Posting
    http://www.cisco.com/c/en/us/support/docs/ip/generic-routing-encapsulation-gre/25885-pmtud-ipfrag.html

Maybe you are looking for