Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
code share

Complete F5 Automated Backup Solution #2

Problem this snippet solves:

On TMOS 12.1 smbclient do not exist any more. But mount.cifs still exist.

In attachment you can find modified original iApp by Thomas Schockaert which use mount.cifs.

Tested on Version:
Comments on this Snippet
Comment made 16-Sep-2016 by Christoph Frischhut 134

Thank you for this, since F5 removed smbclient from the new TMOS versions the original iApp was broken. But now with cifs everything is working again.

Comment made 11-Apr-2017 by Jocelyn Briere 0

Great work to adapt it for V12, thanks. Exactly what I was looking for.

Comment made 21-Apr-2017 by A_Sara 0

I am getting following error on our LTM 12.1.0 image, earlier we were using 11.4 with f5backups2.1 script and it was working fine.

Script (/Common/f5.automated_backup) generated this Tcl error: (script did not successfully complete: (Retrying with upper case share name mount error(6): No such device or address Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) while executing "exec $scriptfile" line:17))

Need your help to fix this issue to continue with automatic backup iApp.

Comment made 21-Apr-2017 by MAG 15

Hi, A_Sara
1. please check letter case of msshare
2. iApp don't work after upgrade or you try use it on clean 12.1.0 install? 3. Is your share has spaces on it?
4. Do you use dns name of server or it ip address? If DNS is nslookup from cli resolve this name?
5. Check leading or tailed spaces of msshare?
6. Try to change on iApp template mount -t cifs //\${server}\${msshare} to mount -t cifs \'//\${server}\${msshare}\'

p.s. You can contact with me directly by mag@comptek.ru...

Comment made 01-May-2017 by A_Sara 0

Hi Mag,

I verified all settings and still failing to take the automatic backup, I responded already with screenshot of the configuration and error message which I am getting. Requesting you to help us here to fix it.

Comment made 10-May-2017 by Dev 371

I really appreciate the share though on my initial attempt to import and deploy I receive the error "Error parsing template:can't eval proc: "script::run" field not present: "hostname" while executing "tmsh::get_field_value [lindex [tmsh::get_config sys global-settings] 0] hostname" (procedure "script::run" line 2) invoked from within "script::run" line:1." Just curious if anyone knew of a quick solution off the top of their head. Running 12.1

Comment made 01-Jun-2017 by Tom Nelson 0

I am using this script via FTP, everything works great except the local deletion of the UCS file. I get a backlog of *.ucs files in /var/local/ucs. This does not happen every day, it seems to be random. The output of scriptd.out all appears to be normal.

Comment made 14-Aug-2017 by Travis.Kamish 0

Hello I am trying to set this up but when I try to create the application to tie this and start the backup I get the following error. "script did not successfully complete: (The connection to mcpd has been lost, try again. while executing "tmsh::cd .." line:4)"

Comment made 09-Oct-2017 by Patrick1507 0

Same issue! Could you please provide an Update.

BIG-IP v12.1.1 (Build 2.0.204)

Comment made 23-Oct-2017 by Travis.Kamish 0

I had HSL running and had to remove that to get this to work. There is a bug with this backup and HSL.

Comment made 28-Nov-2017 by aaperson 55

Thank you for pointing out that TMOS 12.1 is missing SMB. Been trying to figure out why I couldn't get the original to work. Also getting error. "script did not successfully complete: (The connection to mcpd has been lost, try again. while executing "tmsh::cd .." line:4)"

Comment made 28-Nov-2017 by amjadb 0

Hi All,

We recently installed the HF2 for 12.1.2 and the iApp stopped placing the backup file into the remote server. It is saying "Permission denied"...We are using SCP and I suspect its related to the encryption key. Any suggestions out here?

Comment made 06-Dec-2017 by Seven11 2

Hi All,

i want to use the iapp with scp and private key. Which is the correct format to enter the key in the gui? TMOS 13.0.0 HF3.


Comment made 13-Dec-2017 by tabernarious 244

This is now available on GitHub! Please look here for the latest version, and submit any bugs or questions as an "Issue" on GitHub:


As a BACKUP, look in the DevCentral CodeShare. This MAY NOT HAVE THE LATEST VERSION:


I needed to troubleshoot an issue and ended up rolling in many of the proposed and posted fixes into a new iApp.

# iApp VERSIONS (From what I gathered perusing DevCentral)
# ~v2.0  - 20140312 - Initially posted releases (v11.4.0-11.6.x? compatibility). (Developed/posted by Thomas Schockaert)
# v2.1.1 - 20160916 - Retooled SMB upload from smbclient to "mount -t cifs" (v12.1+ compatibility). (Developed/posted by MAG)
# v2.2.1 - 20171214 - Allowed multiple instances of iApp by leveraging $tmsh::app_name to create unique object names. (Developed by Daniel Tavernier/tabernarious)
# v2.2.2 - 20171214 - Added "/" to "mount -t cifs" command and clarified/expanded help for SMB (CIFS) Destination Parameters. (Developed by Daniel Tavernier/tabernarious)
# v2.2.3 - 20171214 - Set many fields to "required" and set reasonable default values to prevent loading/configuration errors. Expanded help regarding private keys. (Developed by Daniel Tavernier/tabernarious)
# v2.2.4 - 20171214 - Added fix to force FTP to use binary upload. (Copied code posted by Roy van Dongen, posted by Daniel Tavernier/tabernarious)
# v2.2.4a - 20171215 - Added items to FUTURE list.
# v2.2.5 - 20171228 - Added notes about special characters in passwords. Added Deployment Information and ConfigSync sections. (Developed by Daniel Tavernier/tabernarious)
# v2.2.5a - 20180117 - Added items to FUTURE list.
# v2.2.5b4 - 20180118 - Moved encrypted values for SMB/CIFS to shell script which eliminates ConfigSync issues. Fixed long-password issue by using "-A" with openssl so that base64 encoded strings are written and read as a single line. (Developed by Daniel Tavernier/tabernarious)
# v2.2.5b4+ - 20180118 - Refining changes to SMB/CIFS and replicating to other remote copy types. (Developed by Daniel Tavernier/tabernarious)
# v3.0.0 - 20180124 - (Developed by Daniel Tavernier/tabernarious)
#                   - Eliminated ConfigSync issues and removed ConfigSync notes section. (Encrypted values now in $script instead of local file.)
#                   - Passwords now have no length limits. (Using "-A" with openssl which reads/writes base64 encoded strings as a single line.)
#                   - Added $script error checking for all remote backup types. (Using 'catch' to prevent tcl errors when $script aborts.)
#                   - Backup files are cleaned up after $script error due to new error checking.
#                   - Added logging. (Run logs sent to '/var/log/ltm' via logger command which is compatible with BIG-IP Remote Logging configuration (syslog). Run logs AND errors sent to '/var/tmp/scriptd.out'. Errors may include plain-text passwords which should not be in /var/log/ltm or syslog.)
#                   - Added custom cipher option for SCP.
#                   - Added StrictHostKeyChecking=no option.
#                   - Combined SCP and SFTP because they are both using SCP to perform the remote copy.
# v3.1.0 - 20180201 - (Developed by Daniel Tavernier/tabernarious)
#                   - Removed "app-service none" from iCall objects. The iCall objects are now created as part of the Application Service (iApp) and are properly cleaned up if the iApp is redeployed or deleted.
#                   - Reasonably tested on 11.5.4 HF2 (SMB worked fine using "mount -t cifs") and altered requires-bigip-version-min to match.
#                   - Fixing error regarding "script did not successfully complete: (can't read "::destination_parameters__protocol_enable": no such variable" by encompassing most of the "implementation" in a block that first checks $::backup_schedule__frequency_select for "Disable".
#                   - Added default value to "filename format".
#                   - Changed UCS default value for $backup_file_name_extension to ".ucs" and added $fname_noext.
#                   - Removed old SFTP sections and references (now handled through SCP/SFTP).
#                   - Adjusted logging: added "sleep 1" to ensure proper logging; added $backup_directory to log message.
#                   - Adjusted some help messages.
Comment made 23-Jan-2018 by AN 165

same issue iAPP doesn't work... Has anyone had success working with 12.1.1?

Comment made 23-Jan-2018 by tabernarious 244

AN, What issues are you having? Can you post screenshots or error messages or a more detailed description? Also, have you tried the latest version of the iApp I posted just above your comment? Version 3.0.0.