how do you use OpenVPN Command line


comet424

Recommended Posts

hi I tried googling and I got confused with this suduo command line etc

 

In windows all I have to do is right click  and choose the file to connect

but I wanna use open vpn in a script.. so it connects  then pauses my script stuff for 1 minute so gives time open vpn connects  and then runs script  and then lastly script tells OpenVPN to disconnect the connection..

and lastly  does script files offer IF ElseIF statements....  so If OpenVPN connection failes do not try to run the script and retry 3 times then forget it... elseif then run the script

 

but for the commandline  would it be line  "OpenVPN scriptfile -connect"   and "OpenVPN scriptifile -disconnect"

 

I know I asked last year similar but I couldn't find my old question and I needed commandline not the gui version.. so sorry for reasking same questions

 

soo basically I wanna write the script like this

 

OpenVPN <config file> -connect

x=0

do

     if  OpenVPN(configfile) = connect then

pause 1 min

                   <script stuff I want done>

                  OpenVPN <config file> -disconnect                   

                  exit do

     elseif  then

       x=x+1

        OpenVPN <config file> -connect

         if x=>3   then  exitdo   (if it cant connect 3 times just exit and quit the script file)

       endif

loop

 

 

 

that's something id like it to do if its possible

Edited by comet424
Link to comment

ya I tried that that doesn't actually show live  its not like windows showing second to second 50mb/s   all it showed was 50k/s when the file transfer is done..and then states it only took 0 seconds to complete when it took a minute or so ... but I looking for live second by second

 

and since no one can help me with the OpenVPN or if the IF ELSE statements 

 

in rysnc is there a way to include it in  1..  do not rsynic .recyclinbin     and 2..  give "new persmissions" to the backup server...  as I have to each time after running rsync    run  "New Permissions" under Tools since I don't have administrator access..

Edited by comet424
Link to comment
21 minutes ago, comet424 said:

ya I tried that that doesn't actually show live  its not like windows showing second to second 50mb/s   all it showed was 50k/s when the file transfer is done..and then states it only took 0 seconds to complete when it took a minute or so ... but I looking for live second by second

Works fine for me.

Link to comment

ya not for me  it will say  0:00:00  like that for the time    and 6.74 kbs  

 

but maybe its because im running it as a background script

and I noticed no way to see file transferring like windows does when you copy or move a file  second by second speed rate

 

guess I can live without it or find some other plugin..

 

now I just gotta figure how to OpenVPN in 1 line and get rsynic not to keep syncing recycling bin..  and give administrator rights since its not doing it

 

one of these days it will work perfect for me  just not today lol

 

Link to comment
1 hour ago, comet424 said:

but maybe its because im running it as a background script

and I noticed no way to see file transferring like windows does when you copy or move a file  second by second speed rate

Have you tried running it in the foreground?   When doing that you get real-time reporting on the progress from rsync with the —progress option.

Link to comment

no I tried the command line  in terminal  as I found out couple times 

if you don't run the command line in Webterminal…  Rsync gives error 255 in the script

 

so I've on done the command line to get it started and then  just background

 

heck if possible id like it to just report instead of file names

display 55% rysncing done  speed is 80mb/s  say  as freenas gave a percentage done for rsync

that's what I wouldn't mind seeing  just   like      "Percent Done 58%   Speed 45mb/s"  as a running total for rsync

 

my other issues I asked for ill try googling other websites for answers

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.