Cron job is not working SCP automated shell script

#!/usr/bin/expect -f
# connect via scp
spawn scp "[email protected]:/u04/dumps/test.dmp" /u10/app/
expect {
-re ".*es.*o.*" {
exp_send "yes\r"
exp_continue
-re ".*sword.*" {
exp_send "pwd\r"
interact
above is the automated script to download the file from remote server to local server.
I am trying to download around 2GB file. for that i am using the above automated script. But that script is not working cron service.
Cron is not executing that script to download the file from Remote server to Local Server.

Cron is not executing that script to download the file from Remote server to Local Server.That script only or any script ? Did you try with something else ?
I had a similar problem on a Linux machine, where cron jobs didn't start, and the only solution was to restart cron daemon whenever crontab files were updated.

Similar Messages

  • SM36/37: Specification "After Job" does not work for Daily "periodcity"

    I reviewed http://help.sap.com/saphelp_nw04/helpdata/en/20/2d513897110872e10000009b38f889/content.htm, which states what I am trying to do should work, but it does not.
    Here's the deal:
    1.  I have two jobs: "A" and "B".
    2.  "A" runs Daily.
    3.  I set-up job "B" to run "After job" "A" in my SM36 definition.
    Job "B" will run the next day, but never runs again after that even though job "A" continues to run "Daily" as it should.
    Further info:
    1.  We have "Event-triggered" jobs that run fine, but the "After Job" designation doesn't seem to work ongoingly.
    2.  I can review both jobs "A" and "B" for any "Predecessor" or "Successor" jobs, and, the first jobs to run after the initial set-up DO reference each other (in other words, let's say I schedule job "B" to run "After job" "A" on Tuesday.  After Tuesday's run, Job "A" sees job "B" as it's "Successor" job and job "B" sees job "A" as it's "Predecessor" job), but the definition doesn't last into the next day ONLY FOR JOB "B" (as I mentioned, job "A" always runs fine).
    3.  I can't set the "periodcity" for job "B" because, once I flag it to run "After Job" "A", the "period" options disappear.
    4.  One final tidbit: the variant for job "B" has a "key date" specified so the date is dynamic for each day the job runs.  I can set up job "B" to run "Daily" with this variant and it runs fine, but I wanted it to run AFTER job "A" so it never runs if job "A" doesn't run.  (At this point, it's becoming a matter of principal!)
    Here's my question:
    Why won't job "B" continue to run "Daily" after job "A" (a "Daily" job) runs?
    Thanks in advance,
    Lara

    Please close this thread since you posted the same question here:
    [SM36/37: Specification "After Job" does not work for Daily "periodcity"|SM36/37: Specification "After Job" does not work for Daily "periodcity";

  • Folder action not working outside automator

    I have a folder action to convert and move all mkv files from within the downloads folder. The folder action included (among other) the following script:
    on run {input, parameters}
              set filename to POSIX path of input
              do shell script "/usr/local/bin/mkvdts2ac3.sh -n " & quoted form of filename user name "white" password "*****)" with administrator privileges
      #do shell script "mount -t smbfs //panos:z2kdft50@nas/internal internal" user name "white" password "******)" with administrator privileges
              do shell script "mv " & quoted form of filename & " /Users/white/internal/library/" user name "white" password "****)" with administrator privileges
              do shell script "rm -rf /Users/white/Downloads/*.dts" user name "white" password "*****)" with administrator privileges
              set message to "File " & filename
              return message
    end run
    The total workflow runs perfectly from within automator.
    The problem is that when the folder action is triggered from the system (regular usage, ouside automator) the workflow executes up to the point that the applescript is implemented (I ghave installed growl notifications at various points to know how far the script has run)
    Does anybody have any idea why could this be happening?
    I  have looked around but found no answers.
    Thanks.
    <Edited by Host>

    Thanks.
    I replaced the applescript with the following shell script:
    /usr/local/bin/mkvdts2ac3.sh -n $@
    mv $@ /Users/white/internal/library/
    rm -rf /Users/white/Downloads/$@
    It works.
    I had tried a shell script in the very begining, but I could not get it to work so I resorted to Applescript instead. I felt myself too that applescript was an unnecessary complicated procedure just to run shell commands.
    Anyway, now, each time a dts download finishes, it gets transcoded to dolby digital so that it can be played on my samsung tv (it's media player does not support dts).

  • Automator "shell script" doesn't work

    Hi,
    I'm trying to build an Automator script in OSX 10.6.4.
    -Get selected items in the finder
    -Execute shell script (arguments)
    cd $(dirname "$1")
    for f in "$@"
    do
    /foo/bar/convert "$f" out.pdf
    done
    If I press the "execute" button, the script seems to work, as shown here: http://i.imgur.com/Nyhcd.jpg
    However, if I try to run the script by right-clicking on a file, a pop up message says that "the execute shell script has encountered an error"
    The "convert" command works flawlessy from a Terminal.app window, and the enviroment is correctly set-up in this way:
    export MAGICK_HOME="/Users/gipinet/image_magik/"
    export PATH=$MAGICK_HOME/bin:$PATH
    export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"

    Environment variables are NOT global. They are inherited from a parent process as a subprocess is created by that parent.
    .profile is ONLY read by the shell (bash) when you start a Terminal session. So only the shell and any commands it runs will see those environment variables.
    Since you are not running the Automator workflow from a Terminal session, there is no way for Automator to inherit those environment variables.
    So if those environment variables are needed for your convert utility, then you need to make sure that your Run Shell Script needs to get them on its own.
    You could hard code them into your Run Shell Script, or you could source your .profile
    . /User/yourusername/.profile # notice the . which is the /bin/sh 'source' command
    Of course if your .profile has lots of other stuff that will upset the Automator Run Shell Script, then you may not want to do that. For example, if your .profile were expecting things in its environment that ONLY exist in a Terminal session that might upset your .profile when invoked in Run Shell Script.

  • Alert set through timer job is not working in sharepoint 2010 as expected

    Hi,
    I create the standard sharepoint alerts through timer job.
    in my timer job, i loop through a list and based on the user value in the alert to field i create alert for the users and the condition for the alert are only when new items are created and something changes in the below view.
    all the properties are set fine. Email triggered on new items additions and on specific daily or weekly summary.
    The view filteration is not working at all:(
    But after the timer job ran and set the alert, if i open the alert settings on UI and without changing anything if i click ok , then the view filteration is happening and alerts are working fine.
    What is wrong here? is it a bug or anything am missing?
    Aruna
    try
    SPList Configlist = web.Lists.TryGetList("Configuration");
    foreach (SPListItem oItem in Configlist.Items)
    ProfilePicker = oItem["ProfilePicker"].ToString();
    ProfileViewer = oItem["ProfileViewer"].ToString();
    string MIS = oItem["MIS"].ToString();
    SPList list = web.Lists.TryGetList(ProfileViewer);
    SPList ProfileList = web.Lists[ProfilePicker];
    foreach (SPListItem oItem in ProfileList.Items)
    frequency = oItem["Frequenzy"].ToString();
    created = (DateTime)oItem["Created"];
    string createdDate = created.ToString();
    createdDate = DateTime.Parse(createdDate).ToShortDateString();
    DateTime today = DateTime.Today.Date;
    string dateonly = today.ToString(); ;
    dateonly = DateTime.Parse(dateonly).ToShortDateString();
    SPFieldUserValue fieldValue = null;
    SPFieldUser UserColumn = (SPFieldUser)oItem.Fields.GetField("Alert_x0020_owner");
    fieldValue = UserColumn.GetFieldValue(oItem["Alert_x0020_owner"].ToString()) as SPFieldUserValue;
    if (fieldValue != null)
    alertowner = fieldValue.User;
    alert = alertowner.ToString();
    //if (createdDate == dateonly)
    SPUser user = web.EnsureUser(alert);
    SPAlert newAlert = user.Alerts.Add();
    newAlert.AlertType = SPAlertType.List;
    newAlert.List = list;
    newAlert.DeliveryChannels = SPAlertDeliveryChannels.Email;
    newAlert.EventType = SPEventType.Add;
    if (frequency == "Daily")
    createDailyAlert(newAlert, list, user);
    else
    createWeeklyAlert(newAlert, list, user);
    catch (Exception ex)
    // Danfoss.Sharepoint.Logger.DanfossLogger.LogToOperations(ex, "Exception occurred in setting the profile alert", 0, EventSeverity.Error, DanfossExceptionCategory.General);
    private static void createDailyAlert(SPAlert newAlert, SPList list, SPUser user)
    newAlert.Title = "My Daily Profile viewer Alert";
    newAlert.AlertFrequency = SPAlertFrequency.Daily;
    newAlert.AlertTemplate = list.AlertTemplate;
    newAlert.AlertTime = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 10, 0, 0);
    newAlert.AlertTime = newAlert.AlertTime.AddDays(0);
    SPAlert existingAlert = null;
    newAlert.Properties.Add("filterindex", "4");
    newAlert.Properties.Add("viewid", list.Views["Daily Alert"].ID.ToString("D"));
    newAlert.Properties.Add("filterpath", string.Format("{0}/", list.Views["Daily Alert"].ServerRelativeUrl.TrimStart('/')));
    foreach (SPAlert alerts in user.Alerts)
    string al = alerts.AlertFrequency.ToString();
    // Filter down the alert to the list you wish to report on.
    if (al == "Daily")
    // Found your existing your custom alert. Don't create one.
    existingAlert = alerts;
    if (existingAlert == null)
    newAlert.Update(false);
    private static void createWeeklyAlert(SPAlert newAlert, SPList list, SPUser user)
    newAlert.Title = "My weekly profile viewer Alert";
    newAlert.AlertFrequency = SPAlertFrequency.Weekly;
    newAlert.AlertTemplate = list.AlertTemplate;
    newAlert.AlertTime = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 10, 0, 0);
    newAlert.AlertTime = newAlert.AlertTime.AddDays(0);
    SPAlert existingAlert = null;
    newAlert.Properties.Add("filterindex", "4");
    newAlert.Properties.Add("viewid", list.Views["Weekly Alert"].ID.ToString("D"));
    newAlert.Properties.Add("filterpath", string.Format("{0}/", list.Views["Weekly Alert"].ServerRelativeUrl.TrimStart('/')));
    foreach (SPAlert alerts in user.Alerts)
    string al = alerts.AlertFrequency.ToString();
    // Filter down the alert to the list you wish to report on.
    if (al == "Weekly")
    // Found your existing your custom alert. Don't create one.
    existingAlert = alerts;
    if (existingAlert == null)
    newAlert.Update(false);
    This is my code. alerts are not sending based on the view:(

    Hi sathyaav,
    I followed the example and made a test in my environment, it works like a charm.
    I suggest you check if you have inputed the valid site URL when you create the project solution.
    If you deployed succeed in the Central Administrator Site using Visual Studio, then the job named "Simple Job Definition" will appear in the job definition list.
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Zhengyu Guo
    TechNet Community Support

  • DPMS/Screen blanking not working in gnome-shell

    The title pretty much sums it up. I've tried setting screen blanking in gnome-control-center->power, but it doesn't seem to work. However DPMS has worked in pretty much every other WM I've tried by default.
    I've installed gnome-shell and gnome-control-center. Not using gdm.
    I've tried 'xset -dpms' which apparently should've helped at least in earlier gnome releases, but it makes no difference on my system.
    Any ideas what could be causing this?

    \hbar wrote:
    Could you be more specific so as to what does not work? Is it the automatic screen blanking, or just plain screen blanking? If you run
    xset dpms force off
    does the screen turn off?
    I want my screen to turn off automatically when system is not in use, so I've enabled the automatic screen blanking from gnome settings.
    That command turns my monitor off fine, but doesn't happen automatically when system is idle like it does in other WMs
    \hbar wrote:Also 'xset -dpms' disables dpms, so I don't understand how that would help.
    Apparently there's been an issue where xserver's dpms settings get in gnome's way, and disabling dpms with xset has helped some people in arch forums and others. Although if I'm not mistaken that issue should be fixed already.

  • Dropbox appindicator is not working in Gnome shell

    Hello,
    I have installed "dropbox" package from AUR and also "gnome-shell-extension-appindicator-git"  (and it's dependencies which are libindicator and libappindicator and some other packages) from AUR too.
    My appindicators are now working except for Dropbox and Skype. (but Skype is not my problem here)
    The only relevant information that I have found about my issue is the link below but that does not seem to help too.
    https://github.com/rgcjonas/gnome-shell … /issues/22
    My problem is that Dropbox is still showing it's systray icon instead of it's appindicator.
    Anyone has faced the same problem or would you have any ideas? I would appreciate your help.

    \hbar wrote:
    Could you be more specific so as to what does not work? Is it the automatic screen blanking, or just plain screen blanking? If you run
    xset dpms force off
    does the screen turn off?
    I want my screen to turn off automatically when system is not in use, so I've enabled the automatic screen blanking from gnome settings.
    That command turns my monitor off fine, but doesn't happen automatically when system is idle like it does in other WMs
    \hbar wrote:Also 'xset -dpms' disables dpms, so I don't understand how that would help.
    Apparently there's been an issue where xserver's dpms settings get in gnome's way, and disabling dpms with xset has helped some people in arch forums and others. Although if I'm not mistaken that issue should be fixed already.

  • "Take Picture" task does not work in Automator

    I have downloaded the task "Take Picture" from automator.us, installed it and used it in Automator. It does not work! The log reads that an error occurred in (NSReceiverEvaluationScriptError: 4 (-2700)).
    I activated the GUI scripting as pointed out on the download page.

    I have the same problem, anybody pls

  • "Search for Jobs" link not working in E-Recruitment

    Hi,
    Whenever Employee/External Candidate clicks on the link "Search for Jobs" on the start page, list of jobs are not getting displayed despite after data is available.

    Hi ,
      Go to SPRO-personnel management-Employee self services-homepage framework - resources-edit resources
    select the resource for Search for job .... and check if the URL path is given.
    Thanks
    Sunitha

  • Weblogic job scheduler not works in cluster

    I have configured a cluster with two managed servers. I have configured a datasource for job scheduler for this cluster
    if I shut down one server job does not start on other server of cluster.
    manged server logs give below exception
    Exception in thread "Thread-211" java.lang.NullPointerException
         at com.mysql.jdbc.Statement$1.run(Statement.java:96)
    If I remove the option 'datasource for job scheduler' in Clsuter->MyServer->scheduling , this exception goes.
    job scheduler table weblogic_timers also remains empty.
    I feel that there is some issue with the schema of weblogic_timers. How can I see something in log to know what is the issue.
    Please help I am struggling from a week.

    I have configured a cluster with two managed servers. I have configured a datasource for job scheduler for this cluster
    if I shut down one server job does not start on other server of cluster.
    manged server logs give below exception
    Exception in thread "Thread-211" java.lang.NullPointerException
         at com.mysql.jdbc.Statement$1.run(Statement.java:96)
    If I remove the option 'datasource for job scheduler' in Clsuter->MyServer->scheduling , this exception goes.
    job scheduler table weblogic_timers also remains empty.
    I feel that there is some issue with the schema of weblogic_timers. How can I see something in log to know what is the issue.
    Please help I am struggling from a week.

  • Automator Shell Script

    Hi,
    I am very new to Automator and know the very basics about Unix but use Terminal frequently for very repetitive tasks (which I usually find on the web) - one of which is creating MD5 of all files within a specific folder. To achieve this I generally open Terminal, go to a specific project folder and enter: find . -print0 | xargs -0 -I{} md5 "$@"{} >> md5.chk
    This then creates a txt file called md5.chk within the folder which lists all off the files within that folder (with file path) as well as all the the associated checksums for these files.
    I would like to streamline this process a little by creating a service with Automator so I can select a Folder within Finder and select the require Service.
    Unfortunately I am not getting very far. This is where I am:
    1. Open Automator and select Service
    2. Add "Get Specified Finder Items" action
    3. Add "Run Shell Script" action (Pass input: as argument) with the following: find . -print0 | xargs -0 -I{} md5 "$@"{} >> md5.chk
    Unfortunately this doesn't achieve the required result. I presume there are some elements within the shell script that I am simply missing. Can anyone help?
    Thanks

    This is a test. It is ONLY a test.
    Change your Automator "Run Shell Script" to:
    ( pwd
    echo "+++++"
    /bin/ls -dlae0@ .
    echo "+++++"
    id -a
    echo "+++++"
    echo "number of args: $#"
    echo "+++++"
    printenv
    echo "+++++"
    echo find "$@" -type f -print0
    echo "+++++"
    find "$@" -type f -print0 | xargs -0 -I{} echo "{}"
    ) >/tmp/tmp.txt
    Then look at /tmp/tmp.txt and see if the expanded command look they it should. You can get to the /tmp directory using Finder -> Go -> Go to Folder -> /tmp
    The double-quotes will be missing (as the shell will swallow them), however, what you are interested in is did the "$@" expand to the desired directory.
    The pwd will tell us what the current working directory is. This could be important, as maybe you do not have permissions to use that directory.
    The /bin/ls will tell us the ownership and permissions of the current working directory.
    The id -a will tell us what account the automator script is running as
    The $# will tell us how many arguments were passed as part of the "$@"
    The printenv will tell us what environment variables have been set.
    The find|xargs is changed to replace md5 with echo, so that we can see that the "{}" expanded to.

  • Automator shell script to zip

    I'm trying to follow some advice I found to use an automator Finder Plugin to zip selected files and save the zipped files. It's not working. Here's what I'm doing:
    1) Open Automator
    2) Under Libarary, select Automator.
    3) Drag Run Shell Script to Workflow window.
    4) Leave Shell = bin/bash, make Pass input = as arguments.
    5) Enter code:
    for f in "$@"
    do
    zip -r "$f" "$f"
    done
    6) Save As Pluging. Name = ZipClean, Plug-in for = Finder.
    7) Try it out... no joy. Select one file and right click to Automator -> ZipClean. It seems to go away for a bit of time and come back, but no new zip has been created (really, I searched!).
    I know this is a silly script but if I can get this version to work, I'm going to add -x *.DS_Store -x .svn in order to create zips that are not corrupted by osx and svn invisible files and directories.
    So bottom line... why isn't the zip file being created and stored? When I do this directly in a terminal window it seems to work ok.
    Thanks in advance!
    joe

    If you plug your shell script into Automator and use a Finder action to pass items to it, it works for a folder but fails for a single file. You might need to tweak the parameters for a plug-in - refer to the zip manual page. You can also use ditto (I posted an AppleScript action earlier using ditto in this reply).

  • Automator shell script won't run

    Hi,
    I'm putting together a little Automator app that opens whenever I double-click on an .exe file and opens that file with wine. So far, however, I've had little luck. I've created a shell script automator app with the following script:
    for f in "$@"
    do
              /usr/local/bin/wine "$f" &
    done
    Outside of Automator the script works just fine. However, as an Automator app it doesn't work at all; nothing happens, even though Automator tells me that that the workflow was successfully completely. What am I doing wrong?
    Thanks,
    Alex

    Automator uses /bin/bash as the shell.
    Running your script interactive has a different environment from running under Automator.  For one thing, stdin/stdout/stderr are pointing to a tty (actually a pseudo device /dev/pty).  Perhaps this is affecting how Wine us behaving.
    Other issues might be where your current working directory is located, or some environment variable (such as PATH) that is not the same under Automator that exists when running interactively.
    You might try capturing things like
    ( printenv
      pwd
      id -a
      echo "\$# $#"
    ) >/tmp/automator.environment

  • Help 'Exiting' after Automator Shell Script Execution

    Hello,
    I've recently installed and got running GCalDaemon (http://gcaldaemon.sourceforge.net/) which allows me to Synch Rainlendar <-> Google Calendar through iCal (You can also synch iCal <-> Google Calendar). I needed to start up a shell script/applescript after each startup/login in order for GCalDaemon to start the synching process each time and continue to do so at the timed intervals. I would do so by the following terminal code:
    cd /usr/local/sbin/GCALDaemon/bin
    ./standalone-start.sh
    I then tried automating this process and came across shell script execution through Automator. I did so and created a .app with the above mentioned code. This works and it starts up the necessary .sh file I need and the snyching works under StartUp. My concern is however, how do I exit terminal once the code has executed the necessary file? All I have in my .app is the above mentioned code for now. I just need it to exit terminal because on startup or after starting the program, I get this issue (See Attachment)
    This continues to run, so my guess is that I need to add code to exit terminal and allow the .app to close itself properly after doing so.
    Please guide me in the right direction.
    Picture Belows shows what happens when I run the Automator App. It continues to run until I quit out of the app manually (TheGCal programs works fine though). I feel I need to have app quit Terminal or fully end the process and quit out on it's own.
    Thanks
    <table style="width:auto;"><tr><td></td></tr><tr><td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From GCalDaemon</td></tr></table>

    i redirected the command output to /dev/null which is unix equivalent of a black hole and I also redirected error output to standard output in case the script produces any errors.
    also & at the end tells it to continue without waiting for the script to finish.
    Message was edited by: V.K.

  • Why does this work? (dmenu_run shell script...)

    I'm very confused at what this is doing. dwm knowledge would help to understand my question. I don't understand how this script can take a font name with a space in it, the way dwm's default config does, and understand it as one argument.
    #!/bin/sh
    exe=`dmenu_path | dmenu ${1+"$@"}` && exec $exe
    Before updating to a newer version of dmenu (where this is included), I had written my own dmenu_run script. Although I wrote it, I actually don't understand how this one worked either. It was a trial and error thing, and when I try to think it through I always conclude that it shouldn't work.
    #!/bin/bash
    IFS="\t" # (was actually a literal tab character in my script)
    `dmenu_path | dmenu $*`
    This does not work without redefining $IFS, so I figured that dwm is not somehow making sure that spaces are interpretted correctly. But by stopping spaces from separating arguments, shouldn't this cause huge problems for everything except the font name?
    An example of how this would be called by dwm:
    dmenu_run -fn -*-dejavu sans-medium-r-normal-*-12-*-*-*-*-*-*-*
    (Note the space in the font name)
    So what is going on here? I realize that my question is somewhat confusing. I'm happy to clarify anything that is confusing - I found it very hard to clearly ask this question.
    Last edited by fflarex (2008-11-07 05:06:24)

    First off, sorry for all the shell-speak. This is a bit of an edge case, so it's sort of unavoidable. That said, I'll summarize what you need to know at the end.
    The dwm version of the script uses $@ in double quotes. @ contains all the parameters passed to the shell, just like * does. The main useful difference is a special case: when double-quoted, $@ expands to the list of arguments, each as a single shell word. Double-quoted $* expands to the list of arguments as a single word delimited by $IFS. (Both variables expand to the list of arguments [with word splitting applied according to $IFS, hence your spaces problem] when unquoted.) Here's the logic flow:
    1. dwm calls dmenu_run with the list of arguments specified in your config.h. It calls it directly, not running a command through a shell, so word splitting is never performed and spaces in values don't matter.
    2. dmenu_run calls dmenu with the list of arguments it was given. It uses two shell tricks: first, quoted-@ to pass the list of arguments without word splitting. Second, the ${foo+bar} expansion syntax, which expands to bar if foo is defined, otherwise the null string (""). So it expands to the full list of arguments, each as a single word, only if arguments were passed (if $1 is defined).
    What you need to know: You almost always want to use '"$@"'. Unless you want all your arguments as a single string, in which case you want '"$*"'. Other forms are practically useless.
    Last edited by skymt (2008-11-07 14:26:58)

Maybe you are looking for

  • HT4623 Please help , I cant do anything on my I-Pad , Can not connect to server .

          I Cant do anything on my I-Pad all of a sudden , says cant connect to server

  • Dock gone & other Finder issues

    Just updated my MacMini to the latest Safari & for MobileMe last night. This morning I turn on my computer and find - no dock, the yellow minimize button does not work, system preference pane is acting strange. I pulled out of the library and dropped

  • Network Error Times Out: -1001

    Hello: I am running an iMac G5 using Mac OS X Version 10.4. When I use my Software Update in my System Preferences to checck for new updates, I find them fine. When I tried to update my OS X, it will start to download, and then half way through the p

  • No puedo hablitar Siri, alguien que me ayude

    Por alguna razon Siri no esta habilitado, entro a General y no esta, solo lo veo en localización como activo

  • Copying pages and states.

    Is there a way to copy or import a page with different states into another fireworks document? I can't seem to find an easy way of doing this. Cutting and pasting does nothing but copy the images. Basically what I'm looking for is a way to append one