A Good On-Line Doc

Samba Docs

Version (currently 3.4.3 - going to 3.6.6)

!/opt/samba/bin/smbstatus -V

Samba Help

!/opt/samba/bin/smbclient -?


Avante Common Logic

SYSS9100.1 is a common Avante program to build (but not execute) common Samba commands.
In the following examples, we:
  1. Used SYSS9100.1 to get the intitial connection point (G: drive = //daysup.com/dsc)
  2. Want to deal with sub-folder path: group/Reports_Browzer\ADP_Payroll\Staging
  3. We want to build a "dir" command to see the contents of the sub-folder
  4. Here is the actual code:
    1. PASSED.DATA = 1
    2. PASSED.DATA<2> = Reports_Browzer\ADP_Payroll\Staging
    3. CALL SYSS9100.1(RETURN.DATA, PASSED.DATA)
    4. SAMBA.STMT = RETURN.DATA<1>

Samba Examples

View contents of a directory (dir) (one of the SYSS9100.1 options)
!/opt/samba/bin/smbclient //daysup.com/dsc -D "group/Reports_Browzer\ADP_Payroll\Staging" -U login%pw redacted -c dir

Delete a specific file from Windows (del)1,2
!/opt/samba/bin/smbclient //daysup.com/dsc -D "group/Reports_Browzer\ADP_Payroll\Staging" -U login%pw redacted -c 'del "filename"'

Copy a file from Staging to _HOLD_1,2
!/opt/samba/bin/smbclient //daysup.com/dsc -D "group/Reports_Browzer\ADP_Payroll\Staging" -U login%pw redacted -c 'get "from_filename" "_HOLD_/to_filename"'

Copy a file from _HOLD_ to Staging1,2
!/opt/samba/bin/smbclient //daysup.com/dsc -D "group/Reports_Browzer\ADP_Payroll\FJD-Weekly" -U login%pw redacted -c 'put "_HOLD_/from_filename" "to_filename"'
1 Note the file name is enclosed in double quotes & the entire command is enclosed in single quotes!
2 This used the pre-build "dir" logic (see 1st example), then replaced the "dir" logic with the desired del/get/put logic prior to executing the Samba command.