Anonymous_User Absent Member.
Absent Member.
2205 views

Netware scripting issue - perl, bash or nscript to run rsync

I'm having trouble getting started with scripting on netware. (nw6.5sp4)

I need to be able to use cron to schedule 3 rsync processes but I don't
know how long they will take and I don't want them running together.

Basically I want any method at all of being able to start rsync then start
another when the first has finished.

I thought it would be simple to use perl but find that the syntax that
works to "execute a command and wait" on perl for linux or windows does
not not work for me on netware:
$result = `ext_command` #uses backticks
with this method the external command (myrsync.ncf) never runs.
myrsync.ncf runs fine on the command line and contains this line:
sys:\rsync\rsync -arz -v --delete / myserv::USERS --volume=USERS: --
port=873 --progress

I've tried using NLM's instead of the NCF file and find that only the
first one runs. Closing the first NLM (say nwconfig) does not cause the
second to run and in fact the script never completes.

I've tried the perl "system" function too. Multiple rsync's all load at
once. Perl docs state: "parent process waits for the child process to
complete"


If anyone could help I'd appreciate it.
Many thanks
Julian

Labels (2)
0 Likes
4 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Netware scripting issue - perl, bash or nscript to run rsync

Why don't you use a NCF File with the %WHILE function that is described when
you type 'help %WHILE'..

regards christian
--
Christian Mies
GNE IT Solution GmbH
cmies@NOSPAMgne.de

....for any problem their will be a solution
"Julian" <nothanks@paradise.net.nz> schrieb im Newsbeitrag
news:bGLlg.4947$tN4.3527@prv-forum2.provo.novell.com...
> I'm having trouble getting started with scripting on netware. (nw6.5sp4)
>
> I need to be able to use cron to schedule 3 rsync processes but I don't
> know how long they will take and I don't want them running together.
>
> Basically I want any method at all of being able to start rsync then start
> another when the first has finished.
>
> I thought it would be simple to use perl but find that the syntax that
> works to "execute a command and wait" on perl for linux or windows does
> not not work for me on netware:
> $result = `ext_command` #uses backticks
> with this method the external command (myrsync.ncf) never runs.
> myrsync.ncf runs fine on the command line and contains this line:
> sys:\rsync\rsync -arz -v --delete / myserv::USERS --volume=USERS: --
> port=873 --progress
>
> I've tried using NLM's instead of the NCF file and find that only the
> first one runs. Closing the first NLM (say nwconfig) does not cause the
> second to run and in fact the script never completes.
>
> I've tried the perl "system" function too. Multiple rsync's all load at
> once. Perl docs state: "parent process waits for the child process to
> complete"
>
>
> If anyone could help I'd appreciate it.
> Many thanks
> Julian
>



0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Netware scripting issue - perl, bash or nscript to run rsync

> Why don't you use a NCF File with the %WHILE function that is described
> when you type 'help %WHILE'..


Thanks for your reply.
I did not know about %WHILE. I can not find any documentation on %WHILE
and can't get it to work using the HELP as desribed. It's not lkisted in
netware 6.5 documentation. If you have an idea on how I would use it to
suit the purpose of running multiple rsync's one after another I'd
appreciate it.

I could not see how %WHILE could be useful. If I use the following as an
example:
%WHILE (loaded monitor) {load nssmu}
-Command prompt no longer available until I unload monitor
-CPU at 100%
-nssmu never loads even when I unload monitor.

I stumbled accross %IF as well. I could possibly get %IF to work if used
in conjunction with cron. I'd need to start the first RSYNC, then later
start the next if the first was not running etc. This would not be ideal
and I'd have to have different copies of the RSYNC.NLM so that I could
determine which one was running:
example:
%IF !loaded rsync2&rsync3 then cmd rsync1
It still becomes guesswork as to when to attempt the load and how often.

Thanks
Julian

>
> regards christian
> --
> Christian Mies
> GNE IT Solution GmbH
> cmies@NOSPAMgne.de
>
> ....for any problem their will be a solution
> "Julian" <nothanks@paradise.net.nz> schrieb im Newsbeitrag
> news:bGLlg.4947$tN4.3527@prv-forum2.provo.novell.com...
> > I'm having trouble getting started with scripting on netware.

(nw6.5sp4)
> >
> > I need to be able to use cron to schedule 3 rsync processes but I don't
> > know how long they will take and I don't want them running together.
> >
> > Basically I want any method at all of being able to start rsync then

start
> > another when the first has finished.
> >
> > I thought it would be simple to use perl but find that the syntax that
> > works to "execute a command and wait" on perl for linux or windows does
> > not not work for me on netware:
> > $result = `ext_command` #uses backticks
> > with this method the external command (myrsync.ncf) never runs.
> > myrsync.ncf runs fine on the command line and contains this line:
> > sys:\rsync\rsync -arz -v --delete / myserv::USERS --volume=USERS: --
> > port=873 --progress
> >
> > I've tried using NLM's instead of the NCF file and find that only the
> > first one runs. Closing the first NLM (say nwconfig) does not cause

the
> > second to run and in fact the script never completes.
> >
> > I've tried the perl "system" function too. Multiple rsync's all load

at
> > once. Perl docs state: "parent process waits for the child process to
> > complete"
> >
> >
> > If anyone could help I'd appreciate it.
> > Many thanks
> > Julian
> >

>
>


0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Netware scripting issue - perl, bash or nscript to run rsync

> > Why don't you use a NCF File with the %WHILE function that is
described
> > when you type 'help %WHILE'..

>
> Thanks for your reply.
> I did not know about %WHILE. I can not find any documentation on %WHILE
> and can't get it to work using the HELP as desribed. It's not lkisted

in
> netware 6.5 documentation. If you have an idea on how I would use it to
> suit the purpose of running multiple rsync's one after another I'd
> appreciate it.

yes, it isn't described very well.

>
> I could not see how %WHILE could be useful. If I use the following as an
> example:
> %WHILE (loaded monitor) {load nssmu}
> -Command prompt no longer available until I unload monitor
> -CPU at 100%
> -nssmu never loads even when I unload monitor.


the rsync while command I've used, looks like this:
#%while (loaded rsync) {cmd delay 10} rsync -ra -v --progress --stats --
compress --partial --delete ...

is that working for you?

regards
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Netware scripting issue - perl, bash or nscript to run rsync

> the rsync while command I've used, looks like this:
> #%while (loaded rsync) {cmd delay 10} rsync -ra -v --progress --stats --
> compress --partial --delete ...
>
> is that working for you?


Thanks for clarifying the syntax. Yes that works but It takes over the
server console prompt. If I start rsync that way I can't do anything else
on the server and I can't unload rsync from the console. I'd have to wait
until it finished.

Julian
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.