Skip to main content

Hi Guys,

According to the manual the D3 -d command 

-d data.arg

Stacks data for the process once it is activated. The data argument specified is any string that contains displayable characters and commands prefixed by a backslash.

The D3 implementation is Linux (Redhat) 10.3x

I run this code in Linux and I can see the entries in the TCL stacker: Please just ignore the commented out lines.

 RESCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rxxxxxx\\r"

      RESCMD = RESCMD:"\\rt-det 5 (uz\\rt-select 5\\rt-rew\\rt-rew\\r"

*      RESCMD = RESCMD:"\\rlistfiles \\r"

      RESCMD = RESCMD:"\\r\\r\\rt-det\\r\\rsleep 1\\r\\rexit\\r\\r'"

      EXECUTE RESCMD

*

*      DELCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rdxxxxxx\\r"

*      DELCMD = DELCMD:"\\r\\r\\rt-det\\r\\rtime\\r\\rexit\\r\\r'"

*      execute delcmd

*

*      execute delcmd

*

*      RESCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rdxxxxxx\\r"

*      RESCMD = RESCMD:"\\rt-det 5 (uz\\rt-select 5\\rt-rew\\rt-rew\\r"

*      RESCMD = RESCMD:"\\r\\r\\rt-det\\r\\rsleep 1\\r\\rexit\\r\\r'"

*      EXECUTE RESCMD

 

      ESTAMP = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rdxxxxxx\\rdate\\rtime\\rexit\\r\\r'"

      EXECUTE ESTAMP

*      sleep 20

      crt estamp

 

      EXECUTE "EXIT"

However, when I run this  under CRON - ONLY the first set of instructions come out onto the TCL stack:

t-det 5 (uz
t-select 5

etc. etc.

I am (should expect) the subsequent TCL instructions that are issued in the pgm :

ESTAMP = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rdxxxxxx\\rdate\\rtime\\rexit\\r\\r'"

      EXECUTE ESTAMP

Has anyone else experienced something similar? Or am I doing something wrong?

Thanks

Stefano



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

Hi Guys,

According to the manual the D3 -d command 

-d data.arg

Stacks data for the process once it is activated. The data argument specified is any string that contains displayable characters and commands prefixed by a backslash.

The D3 implementation is Linux (Redhat) 10.3x

I run this code in Linux and I can see the entries in the TCL stacker: Please just ignore the commented out lines.

 RESCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rxxxxxx\\r"

      RESCMD = RESCMD:"\\rt-det 5 (uz\\rt-select 5\\rt-rew\\rt-rew\\r"

*      RESCMD = RESCMD:"\\rlistfiles \\r"

      RESCMD = RESCMD:"\\r\\r\\rt-det\\r\\rsleep 1\\r\\rexit\\r\\r'"

      EXECUTE RESCMD

*

*      DELCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rdxxxxxx\\r"

*      DELCMD = DELCMD:"\\r\\r\\rt-det\\r\\rtime\\r\\rexit\\r\\r'"

*      execute delcmd

*

*      execute delcmd

*

*      RESCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rdxxxxxx\\r"

*      RESCMD = RESCMD:"\\rt-det 5 (uz\\rt-select 5\\rt-rew\\rt-rew\\r"

*      RESCMD = RESCMD:"\\r\\r\\rt-det\\r\\rsleep 1\\r\\rexit\\r\\r'"

*      EXECUTE RESCMD

 

      ESTAMP = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rdxxxxxx\\rdate\\rtime\\rexit\\r\\r'"

      EXECUTE ESTAMP

*      sleep 20

      crt estamp

 

      EXECUTE "EXIT"

However, when I run this  under CRON - ONLY the first set of instructions come out onto the TCL stack:

t-det 5 (uz
t-select 5

etc. etc.

I am (should expect) the subsequent TCL instructions that are issued in the pgm :

ESTAMP = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rdxxxxxx\\rdate\\rtime\\rexit\\r\\r'"

      EXECUTE ESTAMP

Has anyone else experienced something similar? Or am I doing something wrong?

Thanks

Stefano



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

What does your crontab entry look like ?

Why don't you run the command from within D3 as a phantom or with the background command ?



------------------------------
Bryan Buchanan
------------------------------

What does your crontab entry look like ?

Why don't you run the command from within D3 as a phantom or with the background command ?



------------------------------
Bryan Buchanan
------------------------------

Hi @Bryan Buchanan

The CRONTAB has the following entry:

0 2 * * 2-6 /usr/local/bin/restorepick >>/var/log/restore_logs/d3_restore_cron.out 2>&1

I would prefer to solve why it is not working (was working on a 7.x implementation) rather than change to (if you know what I mean)

Stefano



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

Hi @Bryan Buchanan

The CRONTAB has the following entry:

0 2 * * 2-6 /usr/local/bin/restorepick >>/var/log/restore_logs/d3_restore_cron.out 2>&1

I would prefer to solve why it is not working (was working on a 7.x implementation) rather than change to (if you know what I mean)

Stefano



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

Hi Stefano,

and your script ?

I've got 10.3.2 (CentOS 8) and 10.4.0 (Alma 9), so yes, it would be nice to see what works.

Bryan



------------------------------
Bryan Buchanan
------------------------------

Hi Stefano,

and your script ?

I've got 10.3.2 (CentOS 8) and 10.4.0 (Alma 9), so yes, it would be nice to see what works.

Bryan



------------------------------
Bryan Buchanan
------------------------------

Hi @Brian Buchanan

Is that D3 10.4 you're on?
Brave man - I tried some months ago and reverted to 10.3x - I had some issues with 10.4.

Here's the Linux script:

Thanks

Stefano



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

Hi @Brian Buchanan

Is that D3 10.4 you're on?
Brave man - I tried some months ago and reverted to 10.3x - I had some issues with 10.4.

Here's the Linux script:

Thanks

Stefano



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

Can't see the script ?



------------------------------
Bryan Buchanan
------------------------------

Can't see the script ?



------------------------------
Bryan Buchanan
------------------------------

Yeah - sorry this page does not honour a paste from snip :(

I'll obtain and paste when I get txt version.

Thanks

Stefano 



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

Can't see the script ?



------------------------------
Bryan Buchanan
------------------------------

Hi @Brian Buchanan

Apologies for the delay; here is the CRON script and the Linux script we're using.

CRONTAB:

02 10 26 7 * /bin/bash -l /usr/local/bin/restorepick_test >>/var/log/restore_logs/d3_restore_test_cron.out 2>&1

 

 

/usr/local/bin/restorepick_test

#!/bin/bash

source /etc/pick

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

d3 -511 -d  "\\\\r\\\\r$PICKUSER\\\\r$PICKACC\\\\r$PICKPASS\\\\rsr.test2\\\\r" >>/var/log/restore_logs/d3_restore_test_cron_`date +%Y%m%d%H%M%S`.log 2>&1

cat /etc/redhat-release

Red Hat Enterprise Linux release 8.6 (Ootpa)

All our experiments and testing lead to the fact that a job submitted by CRON will not execute (shell) a D3 process

Here (below) is also a version of sr.test2 (not compete) . None of the lines that initiate d3 -500 process run (whilst under CRON) but the code (sr.test2) executes naturally to termination if executed WITHIN an existing D3 process at TCL. 

 RESCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rd0rmant\\r"

      RESCMD = RESCMD:"\\rt-det 5 (uz\\rt-select 5\\rt-rew\\rt-rew\\r"

*      RESCMD = RESCMD:"\\rlistfiles \\r"

      RESCMD = RESCMD:"\\r\\r\\rt-det\\r\\rsleep 1\\r\\rexit\\r\\r'"

      EXECUTE RESCMD

*

     DELCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rd0rmant\\r"

     DELCMD = DELCMD:"\\r\\r\\rt-det\\r\\rtime\\r\\rexit\\r\\r'"

     execute delcmd

*

 

 



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

Hi @Brian Buchanan

Apologies for the delay; here is the CRON script and the Linux script we're using.

CRONTAB:

02 10 26 7 * /bin/bash -l /usr/local/bin/restorepick_test >>/var/log/restore_logs/d3_restore_test_cron.out 2>&1

 

 

/usr/local/bin/restorepick_test

#!/bin/bash

source /etc/pick

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

d3 -511 -d  "\\\\r\\\\r$PICKUSER\\\\r$PICKACC\\\\r$PICKPASS\\\\rsr.test2\\\\r" >>/var/log/restore_logs/d3_restore_test_cron_`date +%Y%m%d%H%M%S`.log 2>&1

cat /etc/redhat-release

Red Hat Enterprise Linux release 8.6 (Ootpa)

All our experiments and testing lead to the fact that a job submitted by CRON will not execute (shell) a D3 process

Here (below) is also a version of sr.test2 (not compete) . None of the lines that initiate d3 -500 process run (whilst under CRON) but the code (sr.test2) executes naturally to termination if executed WITHIN an existing D3 process at TCL. 

 RESCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rd0rmant\\r"

      RESCMD = RESCMD:"\\rt-det 5 (uz\\rt-select 5\\rt-rew\\rt-rew\\r"

*      RESCMD = RESCMD:"\\rlistfiles \\r"

      RESCMD = RESCMD:"\\r\\r\\rt-det\\r\\rsleep 1\\r\\rexit\\r\\r'"

      EXECUTE RESCMD

*

     DELCMD = "!d3 -500 -d -' \\r\\r\\r\\rdm\\rdm\\rd0rmant\\r"

     DELCMD = DELCMD:"\\r\\r\\rt-det\\r\\rtime\\r\\rexit\\r\\r'"

     execute delcmd

*

 

 



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

Hi Stefano,

My testing seems to indicate that you cannot execute a Linux command when the d3 command is executed from a cron job.

Crontab:

50 17 * * * /home/pick/bin/restorepick_test >>/tmp/d3_restore_test_cron.out 2>&1

/home/pick/bin/restorepick

#!/bin/bash

PICKUSER="bjb"

/usr/bin/d3 -11 -d  "\\\\r$PICKUSER\\\\rrun utils test\\\\rexit\\\\r" >>/tmp/d3_restore_test_cron_`date +%Y%m%d%H%M%S`.log 2>&1

utils test

  • *   RESCMD = "!/usr/bin/d3 -5 -d '\\rbjb\\r"
    *   RESCMD = RESCMD:"which (cad\\r"
    *   RESCMD = RESCMD:"exit\\r'"
    *   PRINT RESCMD
    *   RESCMD = '!/home/pick/bin/blah.sh'
       RESCMD = '!/usr/bin/ls'
       EXECUTE RESCMD
       STOP

/home/pick/bin/blah.sh

#!/bin/bash

/usr/bin/d3 -5 -d '\\rbjb\\rwhich (cad\\rexit\\r'

  1. if the script /home/pick/bin/restorepick_test is executed from the shell, the commented lines in utils,test work i.e. d3 is called and it works, but not from a cronjob
  2. if I put the d3 command in a script /home/pick/bin/blah.sh and try to execute it (the other commented out line in utils,test), it won't be called when running from a cron job, but works from the shell
  3. simplest test is to try running "ls". When restorepick_test is run from a shell, works, from a cron job, no.

I suspect there is some weirdness when logging into D3 from the shell  and then executing a shell command in D3 and having all this wrapped in whatever cron is doing. Without cron, all good. Possible some fork/exec stuff going on in Linux when crontabs are executed.

Sorry couldn't be of any help :(

Bryan



------------------------------
Bryan Buchanan
------------------------------