Metal Guitarist Forums banner
1 - 20 of 21 Posts

·
Premium Member
Joined
·
32,450 Posts
Discussion Starter · #1 ·
This week's agenda: get an open source workstation/laptop backup solution (Backup PC) working. It uses Apache to host the UI that users will use to restore their files. Another first for me will be getting Apache to authenticate logins against our Active Directory domain.
 

·
Premium Member
Joined
·
32,450 Posts
Discussion Starter · #4 ·
I would have shot up the walls of that heartache. Bang bang, bitches.
 

·
Banned
Joined
·
21,673 Posts
This week's agenda: get an open source workstation/laptop backup solution (Backup PC) working. It uses Apache to host the UI that users will use to restore their files. Another first for me will be getting Apache to authenticate logins against our Active Directory domain.
Wutcha using for AD authentication, Likewise?
 

·
Premium Member
Joined
·
32,450 Posts
Discussion Starter · #7 ·

·
Premium Member
Joined
·
32,450 Posts
Discussion Starter · #8 ·
GOD DAMN FUCKING WINDOWS, STUPID FUCKING BACKSLASHES FOR DIRECTORIES. :scream:
 

·
Read Only
Joined
·
1 Posts
GOD DAMN FUCKING WINDOWS, STUPID FUCKING BACKSLASHES FOR DIRECTORIES. :scream:
OOO been there before had a hard time trying to get an upload script i wrote working due to the backslashes... nothing like spending an hour pounding your head on the desk then :idea: OH yeah windows is different.... :noplease:
 

·
Premium Member
Joined
·
32,450 Posts
Discussion Starter · #10 ·
You have any experience with Perl, Rick? I have never really had to use it more than running scripts, but now I am having to edit scripts. I'm running into a problem where I have to do username%password, and I'd like to know if I can brace variables like I can in bash/ksh/sh scripts. For example, this is not working:

$username%password

In bash, I would simple do this:

${username}%${password}
 

·
Read Only
Joined
·
1 Posts
You have any experience with Perl, Rick? I have never really had to use it more than running scripts, but now I am having to edit scripts. I'm running into a problem where I have to do username%password, and I'd like to know if I can brace variables like I can in bash/ksh/sh scripts. For example, this is not working:

$username%password

In bash, I would simple do this:

${username}%${password}
Ive worked with several perl scripts but mostly as an extension/expansion on php (I dont really do bash/hash stuff since its not needed so much for web as it is in networking)

In perl you declare variables like this (php works the same way except you dont need My in php to make the variables local)
my $username = "value";
my $password = "value";

I would check out the hash tutorial for perl
PERL Variable Types
 

·
Premium Member
Joined
·
32,450 Posts
Discussion Starter · #15 ·
Here is the line from the perl script:

Code:
$Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName $I_option --user=$userName -E -N -d 1 -c tarmode full --tar=c$X_option - $fileList';
It is failing out, since it is not passing a password to the username. However, this also did not work:

Code:
$Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName $I_option --user=$userName%$userPassword -E -N -d 1 -c tarmode full --tar=c$X_option - $fileList';
I can't quite figure out why, although I am beginning to suspect that either a) the % separator that smbclient wants is reserved for perl as something else, and I need to escape it, or b) $userPassword is not defined anywhere.
 

·
Premium Member
Joined
·
11,451 Posts
FYI, Perl on Windows *should* take the front slashes just fine. It doesn't care, and you can usually even mix.

Oh, and the % in Perl is the indicator for a hash variable. You need to escape it with a backslash "\%" (I think that will work, but I'm SQL mode right now and can't check). It's probably thinking you're trying to use a hash variable in a string with single quotes, which is definitely going to give you an error.
 

·
Read Only
Joined
·
1 Posts
those both could be what is giving you problems

you can escape special character in perl with a backslash \%

what permissions level is your $fileslist (I am guessing this is the password file...) at? you need to chmod to 600

do you have a config file you can put up its hard to get the large picture of the script without seeing it. more than likely something in there is giving it a fit
 

·
Premium Member
Joined
·
32,450 Posts
Discussion Starter · #19 ·
FYI, Perl on Windows *should* take the front slashes just fine. It doesn't care, and you can usually even mix.

Oh, and the % in Perl is the indicator for a hash variable. You need to escape it with a backslash "\%" (I think that will work, but I'm SQL mode right now and can't check). It's probably thinking you're trying to use a hash variable in a string with single quotes, which is definitely going to give you an error.
Unfortunately, it is perl on Linux, communicating with Windows shares through smbclient, which is part of Samba.

However, I did not know that % was a reserved variable, so not escaping it is definitely my problem.
 

·
Read Only
Joined
·
1 Posts
Unfortunately, it is perl on Linux, communicating with Windows shares through smbclient, which is part of Samba.

However, I did not know that % was a reserved variable, so not escaping it is definitely my problem.
thought you were running Samba :D I looked up the documetation on it and the perl/pear site is fubar today so I couldnt find anything...
 
1 - 20 of 21 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top