Solved

How to copy HPUX file to WIndows Share with Cron Job

Posted on 2015-01-23
17
288 Views
Last Modified: 2015-02-24
Hello EE,

I have a windows mount on HPUX however when I try to copy a file from HPUX it tells me I don't have permission to the folder.  I am wondering if I can add permissions to the Cron job or how I can successfully get this HPUX file to a windows share.
0
Comment
Question by:operationsIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 7
17 Comments
 
LVL 21

Expert Comment

by:tfewster
ID: 40567951
Does the copy work when run manually? If not, you don't have write permission to the share. Either because it's mounted read-only or because it's been shared read-only.

cron runs with a minimal environment, but using cron shouldn't make a difference here, unless it's being run as a different user?
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40569163
You have a windows share mounted on your HPUX machine and want to copy from HPUX to that mounted share, right? If that's the case then try:

1 - Create a file on the HPUX machine on the mounted share folder ( touch somefile) - does that work?
2 - Try to read the file you are willing to copy (view somefile) - does that work?

If 1 is not working then you have to mount the share using the correct credentials as you seem to have no write access.

If 2 is not working then you need to get (read) access for the source file.

If 1 and 2 are working then we need to look into the cron job, can you post the cron job entry?
0
 

Author Comment

by:operationsIT
ID: 40569877
@Gerwin - Yes that is correct.
Yes, we do not have write access so can you tell me how to mount it with Windows permissions?
I'm using root for HPUX and a domain account for windows.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 500 total points
ID: 40571305
You use mount -t cifs or mount.cifs, for example:

mount -t cifs //winserver/share /mnt/mountpoint -o username=winuser,password=winpassword,domain=windomain

/mnt/mountpoint is a local folder on HPUX
0
 

Author Comment

by:operationsIT
ID: 40571530
Great I will try it out!
0
 

Author Comment

by:operationsIT
ID: 40577724
I can only execute the mount command with the super user root
Given this isn't a windows account with credentials I cannot access the directory after it's mounted.
Any other suggestions how to get access?  I have to believe this is possible.
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40577814
You can use sbmclient instead, like this:

/opt/samba/bin/smbclient //winserver/share -U domain\\winuser%winpassword -c "cd somefolder ; put yourfile ; quit ;"

Test the connection like this:

/opt/samba/bin/smbclient //winserver/share -U domain\\winuser%winpassword

(you should get an SMB: \> prompt, type help for available commands)
0
 

Author Comment

by:operationsIT
ID: 40587231
Apparently we do not have a compatible version of samba.  Do you know what version is required or is there another options?
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40587578
You have no smbclient? Or are you getting an error? Another possibility would be to just copy the file over, from Windows using WinSCP.
0
 

Author Comment

by:operationsIT
ID: 40588632
Apparently we do not have a compatible version of samba.  We are on  3.0.22 and looks like we need 3.5.4??????

We need to be able to push it from HPUX
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40590502
I'm not into HP version numbers, test new version if you can on another system or go for another solution like WinSCP.
0
 

Author Comment

by:operationsIT
ID: 40604289
I will check if I can do that thank you
0
 

Author Comment

by:operationsIT
ID: 40612668
Ok when I run SAM it uses Root and is access denied trying to access the share.

When I use /opt/samba/bin/smbclient //winserver/share -U domain\\winuser%winpassword it comes back with an error saying:

NT_STATUS_MORE_PROCESSING_REQUIRED
did you forget to run kinit?
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40612675
>> kinit
What is kinit? I never ran kinit, it is working for me as described above,
0
 

Author Comment

by:operationsIT
ID: 40612682
Here is someone having the same issue but not seeing any solutions http://permalink.gmane.org/gmane.network.samba.smb-clients/107
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40612857
You could ask an admin to configure Kerberos for you and the try smbclient again. I've never configured that.
0
 

Author Closing Comment

by:operationsIT
ID: 40628589
Ok after admin exhausted Samba, got him to do the cifs mount and it worked yeah!  Thank you so much.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Bandwidth Hugers how to find them 9 46
Sonos and 5ghz 14 44
How to change subnet mask for Fortigate WAN interface 2 33
how to send mail in unix 2 18
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question