Sponsored Content
Top Forums Shell Programming and Scripting ksh script to get files from Windows Post 302727033 by in2nix4life on Monday 5th of November 2012 02:17:05 PM
Old 11-05-2012
Have you tried mounting the Windows share so you can access the file?

Code:
mkdir /mnt/winbloze

mount -t cifs -o rw,username=<username> //WindowsServer or IP/share /mnt/winbloze

or 

mount -t smbfs -o rw,username=<username> //WindowsServer or IP/share /mnt/winbloze

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh script to analyze log files on AIX 5.2

Hi, I have written a script that traps errors on different servers from the log files based on the current system date. The trapped errors are written to a file and file is sent as an attachment to an email. I would like to run this script for every 2hrs. when i run the script from the second... (0 Replies)
Discussion started by: itzcoolbuddy
0 Replies

2. Shell Programming and Scripting

how to convert unix .ksh script to windows .batch script

I am using awk in my .ksh script but when I am trying to run in windows its not recognising awk part of the ksh script , even when I changed it to gawk it does not work, this is how my .ksh and .bat files look like. thanx. #!/bin/ksh egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End... (1 Reply)
Discussion started by: 2.5lt V8
1 Replies

3. Shell Programming and Scripting

Run KSH script in Windows machine

Hi i created a unix script ksh that goes to a specific folder/xyz/abc, searches for all the .txt files in it and perform some operation on these text file. It runs well in Unix server(machine) Now this script needs to be run on a windows machine having the same folder structure(that is look... (1 Reply)
Discussion started by: mad_man12
1 Replies

4. Shell Programming and Scripting

Comparing same size of files using KSH script

Hi, I have a requirement I have to find out the same size of files with different name in a particular directory. For ex: I have around 1 lack records in a directory and in that I have abcd.jpg, abcd_1.jpg with same size each. I need to seperate these two records from that file.... (3 Replies)
Discussion started by: siri_886
3 Replies

5. Shell Programming and Scripting

KSH Script to watch log files for 2 strings

Hi all, How can I do a ksh script to watch a log file for 2 specific alarms that have one this string : "Connection Error" and the other one: "Failure in sending". I would like to watch for these two alarms in the log and then if each of them repeats for about 30 times to go kill 2 processes. ... (1 Reply)
Discussion started by: Pouchie1
1 Replies

6. Shell Programming and Scripting

How to unzip files from folder in shell script (ksh)?

I have a folder (C:\shellprg\input\) containing .CSV, .zip, .gz files. 1] I want to find all .zip/.gz files from folder (C:\shellprg\input\). 2] unzip/uncompress files into the same folder (C:\shellprg\input\) through shell script. I am using below commands for unzip files, unzip <filename>... (2 Replies)
Discussion started by: Poonamol
2 Replies

7. Windows & DOS: Issues & Discussions

Windows remote to Solaris to execute ksh script

Hi all, I'm not sure if it is correct to post here. I am facing problem wanting to create a batch that run from my Windows XP pc to remote to multiple Solaris server to execute the server's ksh script. :wall: Can anyone give me a hints on how to do that? Thanks. (6 Replies)
Discussion started by: beginningDBA
6 Replies

8. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

9. UNIX for Dummies Questions & Answers

Help with ksh script to list files, cp it to another UNIX server

Hi, I'm quite new to ksh scripting, can someone help me with this. Requirements: I need to create a script that list the files from a user input date range. e. g. format of file: *c1*log.2012-12-22-14-00* *c1*log.2012-12-22-14-00* *c1*log.2012-12-22-14-00*... (7 Replies)
Discussion started by: chococrunch6
7 Replies

10. UNIX for Dummies Questions & Answers

UNIX ksh Copy Files Script

I need a UNIX ksh script that counts the number of files in directory, if the files exceed 20 files, then email results. I want the script to run every hour.. I don't have access to cron.. I'm some what new to UNIX. Windows guy all my career.. this is what I have so far.. #!/bin/ksh # count.sh ... (5 Replies)
Discussion started by: PerlHaven2k
5 Replies
mount_smbfs(1M) 					  System Administration Commands					   mount_smbfs(1M)

NAME
mount_smbfs, umount_smbfs - mount and unmount a shared resource from a CIFS file server SYNOPSIS
/sbin/mount [-F smbfs] [generic-options] [-o name=value] [-O] resource /sbin/mount [-F smbfs] [generic-options] [-o name=value] [-O] mount-point /sbin/mount [-F smbfs] [generic-options] [-o name=value] [-O] resource mount-point /sbin/umount [-F smbfs] [generic-options] mount-point DESCRIPTION
The mount utility attaches a named resource, resource, to the file system hierarchy at the path name location, mount-point, which must already exist. If mount-point has any contents prior to the mount operation, those contents remain hidden until the resource is unmounted. An authorized user with the SYS_MOUNT privilege can perform a mount operation. Also, a user can perform SMBFS mount operations on a directory the user owns. If the resource is listed in the /etc/vfstab file, you can specify either resource or mount-point as the mount command will consult the /etc/vfstab file for more information. If the -F option is omitted, mount takes the file system type from the entry in the /etc/vfstab file. If the resource is not listed in the /etc/vfstab file, the command line must specify both resource and mount-point. The umount utility detaches a mounted file system from the file system hierarchy. An authorized user with the SYS_MOUNT privilege can per- form a umount operation. Also, a user can perform SMBFS unmount operations on a directory the user owns. The network/smb/client service must be enabled to successfully mount a CIFS share. This service is enabled, by default. To enable the service, enter the following svcadm(1M) command: # svcadm enable network/smb/client Operands The mount command supports the following operands: resource //[workgroup;][user[:password]@]server/share The name of the resource to be mounted. In addition to its name, you can specify the following information about the resource: o password is the password associated with user. If password is not specified, the mount first attempts to use the password stored by the smbutil login command (if any). If that password fails to authenticate, the mount_smbfs prompts you for a password. o server is the DNS or NetBIOS name of the remote computer. o share is the resource name on the remote server. o user is the remote user name. If user is omitted, the logged in user ID is used. o workgroup is the name of the workgroup or the Windows domain in which the user name is defined. If the resource includes a workgroup, you must escape the semicolon that appears after the workgroup name to prevent it from being interpreted by the command shell. For instance, surround the entire resource name with double quotes: mount -F smbfs "//SALES;george@RSERVER" /mnt. mount-point The path to the location where the file system is to be mounted or unmounted. The mount command maintains a table of mounted file sys- tems in the /etc/mnttab file. See the mnttab(4) man page. OPTIONS
See the mount(1M) man page for the list of supported generic-options. -o name=value or -o name Sets the file system-specific properties. You can specify more than one name-value pair as a list of comma-separated pairs. No spaces are permitted in the list. The properties are as follows: dirperms=octaltriplet Specifies the permissions to be assigned to directories. The value must be specified as an octal triplet, such as 755. The default value for the directory mode is taken from the fileperms setting, with execute permission added where fileperms has read permis- sion. Note that these permissions have no relation to the rights granted by the CIFS server. fileperms=octaltriplet Specifies the permissions to be assigned to files. The value must be specified as an octal triplet, such as 644. The default value is 700. Note that these permissions have no relation to the rights granted by the CIFS server. gid=groupid Assigns the specified group ID to files. The default value is the group ID of the directory where the volume is mounted. intr|nointr Enable (or disable) cancellation of smbfs(7FS) I/O operations when the user interrupts the calling thread (for example, by hitting Ctrl-C while an operation is underway). The default is intr (interruption enabled), so cancellation is normally allowed. noprompt Suppresses the prompting for a password when mounting a share. This property enables you to permit anonymous access to a share. Anonymous access does not require a password. The mount operation fails if a password is required, the noprompt property is set, and no password is stored by the smbutil login command. retry_count=number Specifies the number of SMBFS retries to attempt before the connection is marked as broken. By default, 4 attempts are made. The retry_count property value set by the mount command overrides the global value set in SMF or the value set in your .nsmbrc file. timeout=seconds Specifies the CIFS request timeout. By default, the timeout is 15 seconds. The timeout property value set by the mount command overrides the global value set in SMF or the value set in your .nsmbrc file. uid=userid Assigns the specified user ID files. The default value is the owner ID of the directory where the volume is mounted. xattr|noxattr Enable (or disable) Solaris Extended Attributes in this mount point. This option defaults to xattr (enabled Extended Attributes), but note: if the CIFS server does not support CIFS "named streams", smbfs(7FS) forces this option to noxattr. When a mount has the noxattr option, attempts to use Solaris Extended attributes fail with EINVAL. -O Overlays mount. Allow the file system to be mounted over an existing mount point, making the underlying file system inaccessible. If a mount is attempted on a pre-existing mount point without setting this flag, the mount fails, producing the error "device busy." EXAMPLES
Example 1 Verifying That an SMBFS File System Is Mounted The following example shows how to mount the /tmp share from the nano server on the local /mnt mount point. You must supply the password for the root user to successfully perform the mount operation. # mount -F smbfs //root@nano.sfbay/tmp /mnt Password: You can verify that the share is mounted in the following ways: o View the file system entry in the /etc/mnttab file. # grep root /etc/mnttab //root@nano.sfbay/tmp /mnt smbfs dev=4900000 1177097833 o View the output of the mount command. # mount | grep root /mnt on //root@nano.sfbay/tmp read/write/setuid/devices/dev=4900000 on Fri Apr 20 13:37:13 2007 o View the output of the df /mnt command. # df /mnt /mnt (//root@nano.sfbay/tmp): 3635872 blocks -1 files Obtain information about the mounted share by viewing the output of the df -k /mnt command. # df -k /mnt Filesystem kbytes used avail capacity Mounted on //root@nano.sfbay/tmp 1882384 64448 1817936 4% /mnt Example 2 Unmounting a CIFS Share This example assumes that a CIFS share has been mounted on the /mnt mount point. The following command line unmounts the share from the mount point. # umount /mnt FILES
/etc/mnttab Table of mounted file systems. /etc/dfs/fstypes Default distributed file system type. /etc/vfstab Table of automatically mounted resources. $HOME/.nsmbrc User-settable mount point configuration file to store the description for each connection. ATTRIBUTES
See the attributes(5) man page for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsmbfscu | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
smbutil(1), mount(1M), mountall(1M), svcadm(1M), acl(2), fcntl(2), link(2), mknod(2), mount(2), symlink(2), umount(2), mnttab(4), nsm- brc(4), vfstab(4), attributes(5), pcfs(7FS), smbfs(7FS) AUTHORS
This manual page contains material originally authored by Boris Popov, bpATbutya.kz, bpATFreeBSD.org. NOTES
The Solaris CIFS client always attempts to use gethostbyname() to resolve host names. If the host name cannot be resolved, the CIFS client uses NetBIOS name resolution (NBNS). By default, the Solaris CIFS client permits the use of NBNS to enable Solaris CIFS clients in Windows environments to work without additional configuration. Since NBNS has been exploited in the past, you might want to disable it. To disable NBNS, set the nbns-enabled service management facility property to false. By default, nbns-enabled is set to true. If the directory on which a file system is to be mounted is a symbolic link, the file system is mounted on the directory to which the sym- bolic link refers, rather than being mounted on top of the symbolic link itself. SunOS 5.11 13 Mar 2009 mount_smbfs(1M)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy