Re: Create a new system variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



matt,
you want to create a wrapper script, OR have the export of your http_proxy
var on your crontab line seperated from your command by an ; or &&

; means that it'll run the following command whether or not the first one
succeeded
&& means that it'll only run it if the previous command completed
successfully

if this is for apt (apt-get / apt-cache), then you can modify the apt.conf
file (do a search for the word proxy) and you can set it up in there and
be set.

now, you could also create a wrapper script

create /usr/local/bin/my_wrapper (or whatever you want to call it)

here are the contents

-cut --------------

#!/bin/bash

export http_proxy='http://www.myproxy.com:80/'

the command

-cut --------------

now, run this

chmod +x /usr/local/bin/my_wrapper

this makes the script executable.

now add /usr/local/bin/my_wrapper to your crontab.

-d

Matthew Benjamin said:
> Can someone tell me how to create a system variable. For instance I
> would like to create a variable called http_proxy that will be available
> for a cronjob. This requires the variable to be available to the process
> when no one is logged in. Export does not work because it disappears
> when you log off. editing the /etc/profile file to include this does not
> work because the variable is created as an environment variable and only
> exits while you're logged on. That's my dilemma. Please help.
>
> mattB.


-+(duncan brown
-+(duncanbrown@xxxxxxxxxxxxxxxxx
-+(http://www.linuxadvocate.net

Blessed is the man who, having nothing to say, abstains from giving wordy
evidence of the fact.
                -- George Eliot




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux