Launchd fails to execute a perl command from a shell script

Hello all,
i have a little script that runs rsync. I use perl to add a timestamp to each line of output. Basically it goes like this:
#!/bin/bash
rsync -avz $sourceFolder $destinationFolder 2>&1 | perl -e "while(<>){s/^/$(date "+%Y-%m-%d %H:%M:%S") [rsync_backup.daily] /g; print;}"
Invoking this script from terminal works perfectly! Invoking it via launchd however fails. There is no error thrown, it just seems to not proceed.
Any help is appreciated.
Cheers.

This is the output from the shell:
/Users/sadmin/Library/rsync_backup
uid=501(sadmin) gid=20(staff) groups=20(staff),501(com.apple.local.ard_admin),256(com.apple.access_vpn),403(c om.apple.sharepoint.group.2),204(_developer),100(_lpoperator),98(_lpadmin),81(_a ppserveradm),80(admin),79(_appserverusr),61(localaccounts),12(everyone),406(com. apple.sharepoint.group.5),502(com.apple.local.ard_reports),253(com.apple.access_ chat),252(com.apple.access_addressbook),401(com.apple.access_screensharing),504( com.apple.local.ard_manage),503(com.apple.local.ard_interact),250(com.apple.acce ss_afp),404(com.apple.sharepoint.group.3),500(com.apple.access_ssh),257(com.appl e.access_backup),254(com.apple.access_calendar),402(com.apple.sharepoint.group.1 ),255(com.apple.access_mail),251(com.apple.access_smb),405(com.apple.sharepoint. group.4),407(com.apple.sharepoint.group.6)
de.open-service.rsync_backup.daily.sh
0
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-color
TMPDIR=/var/folders/A5/A5M1umP6EsKqyAig3q3Bak+++TI/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-VgtdY6/Render
TERM_PROGRAM_VERSION=273.1
USER=sadmin
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-4Jjpml/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:3
PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin :/usr/X11/bin
PWD=/Users/sadmin/Library/rsync_backup
LANG=de_DE.UTF-8
HOME=/Users/sadmin
SHLVL=2
LOGNAME=sadmin
DISPLAY=/tmp/launch-219jsQ/org.x:0
_=/usr/bin/printenv
rsync is /opt/local/bin/rsync
perl is /usr/bin/perl
This is the output via launchd:
uid=501(sadmin) gid=20(staff) groups=20(staff),501(com.apple.local.ard_admin),256(com.apple.access_vpn),403(c om.apple.sharepoint.group.2),204(_developer),100(_lpoperator),98(_lpadmin),81(_a ppserveradm),80(admin),79(_appserverusr),61(localaccounts),12(everyone),406(com. apple.sharepoint.group.5),502(com.apple.local.ard_reports),253(com.apple.access_ chat),252(com.apple.access_addressbook),401(com.apple.access_screensharing),504( com.apple.local.ard_manage),503(com.apple.local.ard_interact),250(com.apple.acce ss_afp),404(com.apple.sharepoint.group.3),500(com.apple.access_ssh),257(com.appl e.access_backup),254(com.apple.access_calendar),402(com.apple.sharepoint.group.1 ),255(com.apple.access_mail),251(com.apple.access_smb),405(com.apple.sharepoint. group.4),407(com.apple.sharepoint.group.6)
/Users/sadmin/Library/rsync_backup/de.open-service.rsync_backup.daily.sh
0
SHELL=/bin/bash
TMPDIR=/var/folders/A5/A5M1umP6EsKqyAig3q3Bak+++TI/-Tmp-/
USER=sadmin
PATH=/usr/bin:/bin:/usr/sbin:/sbin
PWD=/
SHLVL=1
HOME=/Users/sadmin
LOGNAME=sadmin
_=/usr/bin/printenv
rsync is /usr/bin/rsync
perl is /usr/bin/perl

Similar Messages

  • Return codes from sqlldr command from unix shell script

    I am trying to capture error code from sql loader from unix shell script and display proper messages.
    sqlldr parfile=sdb.par control=$cntlfile data=$infile bad=$badFile log=$logFile rows=10000
    rows=10000
    retcode=`echo $?`
    case "$retcode" in
    0) echo "SQL*Loader execution successful" ;;
    1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;;
    2) echo "SQL*Loader execution exited with EX_WARN, see logfile" ;;
    3) echo "SQL*Loader execution encountered a fatal error" ;;
    *) echo "unknown return code";;
    esac
    Eventhough, there are errors while executing sqlldr, it is always returing recode zero. What could be the possible reason
    Please advice

    Is there a typo in your code ?
    sqlldr parfile=sdb.par control=$cntlfile data=$infile bad=$badFile log=$logFile rows=10000
    rows=10000
    retcode=`echo $?` In this code, you get the return code of the statement in bold which is not the sqlldr statement ...

  • Error when running the OWB process flow from the shell script

    Hi,
    I am able to deploy the process flow succesfully but when I execute the process flow from the shell script,I am getting the following error.Previously it worked fine.
    I had to make some chnage in the IP address,so i had to deploy again.
    Connected.
    SQL> @/oracle/product/owb92028/owb/rtp/sql/oem_exec_template.sql OWB_RTR LOC_P_REL PROCESS P_W_SOURCE "," ","
    Elapsed: 00:00:00.00
    Elapsed: 00:00:00.01
    Stage 1: Decoding Parameters
    | location_name=LOC_P_REL
    | task_type=ProcessFlow
    | task_name=P_W_SOURCE
    Stage 2: Opening Task
    declare
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 17
    ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 137
    ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 164
    ORA-06512: at line 205
    Thanks in advance.
    Vinay

    Hi Kamal and kanakam kolla,
    This is just to let you know that,I solved my problem little differently by creating a new location and deployed the process flow.Now my process flow is working fine when i call from the shell script.What i see is that, it does not update properly when we update and redeploy the process flow.So far this is the work arround i could think off and i succesfully tested this.
    Thank you Kamal and kanakam kolla,for giving a thought towards my problem.
    Thanks
    Vinay

  • The data source control failed to execute the insert command

    Hi,
      We have installed SharePoint 2010 on Windows Server 2008 Enterprise Edition. We've started using the "Employee Training Scheduling and Materials" template that is available at
    http://www.microsoft.com/government/en-us/campaigns/Pages/SharePoint-Templates.aspx. Till last friday (17th Oct,2013) everything was working fine, but after that we are getting an error "The data source failed to execute the insert command"
    when I click on the "Save" button available on the Registrations.aspx. Could any one help me resolve this issue?
    Kinldy revert if you need more details.
    Though I see many posts regarding this, most of them are associated with Windows Server 2008 R2. So, most of the hot fixes mentioned there could not help me.
    Your help me is greatly appreciated. Thanks for taking time to go through this post.
    Thanks and Regards
    Praveen.
    Thanks and Regards Praveen.

    I have the exact same problem. I updated the 2007 Employee training template to the 2010 version and then 2 months ago, presumably when our Sharepoint had the July 10th patch 14.0.7102.5004 applied, it all broke. An attempt to register for a class always
    comes back with "Failure to execute insert command".
    I tried changing the DateSourceMode from "ListItem" to "List"  that gets rid of the error but does NOT update the registrations list.
    Anyone have any success fixing this?

  • Custom SharePoint 2010 designer page throws "The data source control failed to execute the insert command" exception while adding the new item after the August 13, 2013 CU has installed

    We have the SharePoint Server 2010 with SP1 environment on which the custom SP2010 designer pages were working as expected before the
    August 13, 2013 CU has installed. But, getting the below exception while trying to add the new item after the CU has installed.
    Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteInsert(IDictionary values)     at
    System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
    06/19/2014 16:49:37.65  w3wp.exe (0x1240)                        0x1300 SharePoint Foundation        
     Runtime                        tkau Unexpected Microsoft.SharePoint.WebPartPages.DataFormWebPartException: The data source control
    failed to execute the insert command. 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.InsertCallback(Int32 affectedRecords, Exception ex)     at System.Web.UI.DataSourceView.Insert(IDictionary
    values, DataSourceViewOperationCallback callback)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.FlatCommit()     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.HandleOnSave(Object sender, EventArgs e)    
    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean
    inclu... 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
    06/19/2014 16:49:37.65* w3wp.exe (0x1240)                        0x1300 SharePoint Foundation        
     Runtime                        tkau Unexpected ...deStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
    I have tried changing the "DataSourceMode" as below, now the insert command is working, but update command is not working.
    <SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" />
    Also, the lookup dropdown fields are displaying the value as "<a href="Daughterhttp://cpsp10/sites/Employees/_layouts/listform.aspx?PageType=4&ListId={8F62F444-FB6A-4F03-9522-C4696B45DCD1}&ID=10&RootFolder=*">Daughter</a>"
    instead of only "Daughter".
    Please provide the solution to get rid of this issue.
    Thanks
    Ramasubbu

    Try below:
    http://social.technet.microsoft.com/Forums/en-US/ae910269-3a0c-4506-844b-e8bc89d95b71/data-source-control-failed-to-execute-the-insert-command
    http://blog.jussipalo.com/2012/01/sharepoint-2010-data-source-control.html
    While there can be many causes for this generic error message, in my case the first parameter or ddwrt:DataBind function inside the SharePoint:FormFields element was
    'i' and I was working with an Edit Form. Changing it to
    'u' as it was with every other FormField fixed the issue.
    <SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Esittaja" __designer:bind="{ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Esittaja')}"
    />
    Explanation:
    DataBind operation type parameters (the first parameter) are listed below:
    'i' stands for INSERT,
    'u' stands for UPDATE,
    'd' stands for DELETE.
    http://webcache.googleusercontent.com/search?q=cache:d9HHY4I7omgJ:thearkfloats.blogspot.com/2014/03/sharepoint-2010-data-source-control.html+&cd=4&hl=en&ct=clnk&gl=in
    If this helped you resolve your issue, please mark it Answered

  • How execute pl/sql command from Oracle ADF Business Components

    can't find examples for how execute pl/sql command from Oracle ADF Business Components and how call pl/sql package procedure from ADF Business Components.
    insert,update,delete rows in view object instance cache is good but if i must do some complex operations while insert,update,delete rows..it's more better for me to call
    pl/sql procedure from oracle db.Am i wrong ????

    Roman,
    this should be similar to how it worked in JDeveloper 9.0.3. hava a look at <JDev903 Home>\BC4J\samples\StoredProc for a code example.
    Frank

  • Execute Unix Mail Command from Store Procedure

    Hi Colleagues!
    I designed a store procedure that Monitoring some Critical tables in my Oracle 8.0.6.1.0 Database But I need to send some Emails from the Store Procedures to Information System Staff when the amount of rows increase too much. I read about UTL_SMTP but my database version is too old to run this package. Also I have the option of Maildemo8i that execute MS Oulook from a Client System But I looking to Send it from my Database(OS HPUX). So please take a look of this issue and I will appreciate any help.
    Your Friend.
    Emmanuel Carrillo Trejos.
    LNB, Republic of Panama(Central America).
    P.D. You can email to: [email protected]

    Do you mean that you want to execute mail or mailx unix commands to send mails.If i am right then probably you are looking for a way to execute operating system commands from your procedure.
    You can refer this link if you want to do that. You need java support in your Oracle database and i believe that Oracle 8 does have jvm running in the instance.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:5079825575573830264::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:952229840241
    Thank you!

  • Failed to execute the insert command

    I have a sign up training calendar that runs on sharepoint 2010, over the weekend i went to install the latest cumulative update http://support.microsoft.com/kb/2817552 and it seems to have broken the signup process. Whenever some goes to sign up for an
    event they see the following error what can i do to fix this?
    Error
    The data source control failed to execute the insert command. d8b915be-5355-4d63-97bb-c9cf3aacad75
    Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: d8b915be-5355-4d63-97bb-c9cf3aacad75
    the error occurs when someone tries to add an event in the calendar & this issues seems to be across the entire sharepoint 2010 foundation farm. How can i resolve this without rebuilding the farm?

    Hi, We are having the same issue. Did anyone get a solution for this? I tried following solution. 
    open
    the page with SPD and update this value.
    OLD: <SharePoint:SPDataSource
    runat="server" DataSourceMode="List"
    NEW: <SharePoint:SPDataSource
    runat="server" DataSourceMode="ListItem"
    That gives me "Access Denied" error.
    User has contribute permission
    for the list. 
    Any solution???

  • Can I execute MySql's command from java application?

    Can I execute MySql's command from java application? And how?
    For example :
    load data local infile 'D:\\myData.txt'
    into table myTable
    fields terminated by ';'
    lines terminated by '\n';

    1. get the jdbc driver for mysql from the mysql site at: http://dev.mysql.com/downloads/connector/j/5.0.html
    2. follow the installation instructiions... which you'll also find in your mysql manual...
    Happy travels. Keith.

  • How to execute a Perl program from within a Java prog

    How do I execute a Perl program from within a Java program.
    Lets say the Perl program that I want to execute is 'abc'. Now, 'abc' requires some input that I want to give it from within the Java program. How do I do it?
    And finally, how do I execute that Perl program from within the Java program.
    If I execute the Perl program alone then I do it in the following way -
    perl abc inp1 inp2 inp3
    where inp1, inp2, inp3 are inputs to the Perl program. I will not be able to change or modify the coding of the Perl program - 'abc' as I do not have access to its code. Its a kind of an application whose usual method of execution is in the above shown way. So, how do I execute 'abc' from within a Java program.

    what part of don't crosspost, don't you understand?
    http://forum.java.sun.com/thread.jsp?forum=4&thread=427193

  • Data source control failed to execute the insert command

    I have a sign up training calendar that runs on sharepoint 2010, over the weekend i went to install the latest cumulative update http://support.microsoft.com/kb/2817552 and it seems to have broken the signup process. Whenever some goes to sign up for an
    event they see the following error what can i do to fix this?
    Error
    The data source control failed to execute the insert command. d8b915be-5355-4d63-97bb-c9cf3aacad75
    Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: d8b915be-5355-4d63-97bb-c9cf3aacad75
    Date and Time: 7/31/2013 9:51:25 PM

    0
    Vote
    Thanks!!!
    It worked for me too

  • How to: execute operating system commands from PL/SQL

    System: IBM pSeries AIX
    Oracle: 11g Enterprise
    Is there a quick way to execute operating system commands from PL/SQL?
    Without creating a JAVA class....
    I need to execute a Loader script.
    I want to do this from within PL/SQL.
    I need to to do 4 things.
    Three require SQL scripts.
    The fourth is SQL*Loader.
    The usual way is with a UNIX script calling 3 SQL scripts and one Loader control file.
    Is there way to do all this from within ONE PL/SQL SCRIPT ??
    Just let me know.

    Is there a quick way to execute operating system commands from PL/SQL?
    NO
    Without creating a JAVA class....
    I need to execute a Loader script.
    I want to do this from within PL/SQL.
    WHY ON EARTH, such action will create a new connection and become a resource hog?
    I need to to do 4 things.
    Three require SQL scripts.
    The fourth is SQL*Loader.
    The usual way is with a UNIX script calling 3 SQL scripts and one Loader control file.
    Which is perfect for the purpose.
    Is there way to do all this from within ONE PL/SQL SCRIPT ??
    Just let me know.
    NO, there is NOT. Nor should there be. Why create unstable ineffcient Mickey Mouse systems, glued together by hacking?
    Sybrand Bakker
    Senior Oracle DBA

  • How to execute Operating System commands from Stored procedure.

    Any help on how to execute Operating System commands from stored procedures will be appreciated.
    Nanditha.

    Search the forums for 'External Procedure' and you will find example code that has been posted before.

  • Executing a DOS Command from JSP

    How do i execute a Dos command from within JSP. I would like to execute a sql Loader command .
    Thanks

    You use Runtime.execute().
    Take a look here for a few of the tricks involved in it:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Executing a bash command from Java

    I want to execute a bash command from within a Java application on the server. I know how to do simple commands, but this command is killing me. I get nothing back when I send it.
    p = Runtime.getRuntime().exec(new String[]{"ps","-ef","","grep","evolution"});
    There is also another part where I want the results piped to awk and fetch out the pids. BUt with this not working the rest is a waste for now.
    Robbie

    evgeni00 wrote:
    Thank you for assuming the posters' stupidity.I can only see the information that you provide. You didn't say you tried the recommendations.
    I read the article and I tried the things he/she is proposing, also the error stream, guess what it outputs: nothing.Maybe you did it wrong. If you didn't do it wrong, then that program you're invoking is poorly written, because it dies in error without producing any error messages.
    And I also searched for the exitValue 138, but didn't get much further than that its some system specific value. If you know where I can find more information, I would appreciate if you let me know about it. As jschell pointed out it's probably app specific. You can search the source code and/or documentation of that program to see if they say what 138 means.
    Apart from that -- it seems that environment and run directory issues can trip this up. Try checking that stuff out. Maybe your program expects something on the executable PATH that isn't there. Or maybe you're not running it in the working directory that you think you are.

Maybe you are looking for

  • What is the data type of the value returned by the List box prompt in crystal

    Post Author: Mudit Kothiyal CA Forum: Formula Hi all, I am creating a report which has a list box prompt. When I am selecting a single value from the list box the report is working fine, but when I am selecting multiple values its not returning any d

  • Bullseye Media Manager

    Hello, I just finished a working version of a media manager I use for my personal account to handle my music and pictures collection. I decided to published it on AUR as I assume it might interest some people. It's a python app with several modules.

  • Finding my iweb site

    I'm trying to find my iweb sites. Problem is I'm traveling with my other computer i.e the one that I did not publish iweb with (I have one dedicated computer to puplish iweb pages). So when I go to my .mac account Home Page, I see "My Pages" and only

  • Trees, temp tables and apex

    Hello, Has anyone had any luck building trees that go against temp tables? My tree works great with a regular table but runs flaky when I change the table to a temp table. Is this a limitation with APEX? Thanks in advance, Sam

  • Multiple columns on same page?

    I'm looking for a way to have a two column page layout, with three columns each that flows from page 1 column 1, to page 1 column 2, then to page 2 column 1 to page 2 column 2, etc. It's for a karaoke list and the columns are Song, Artist, and Song #