A Good On-Line Doc
Samba DocsVersion (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:
- Used SYSS9100.1 to get the intitial connection point (G: drive = //daysup.com/dsc)
- Want to deal with sub-folder path: group/Reports_Browzer\ADP_Payroll\Staging
- We want to build a "dir" command to see the contents of the sub-folder
-
Here is the actual code:
- PASSED.DATA = 1
- PASSED.DATA<2> = Reports_Browzer\ADP_Payroll\Staging
- CALL SYSS9100.1(RETURN.DATA, PASSED.DATA)
- 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.