#!/bin/sh# ver. 1.0 - 04/17/2007 - erik_elsasser@securecomputing.com - e²# wwbackup.sh - Provides a scripted method of backing up the Webwasher appliance configuration# This script is invoked either from the command line or via a scheduled cron job# It is dependent on Webwasher's SSH administration being setup for public key authentication.# This script has very basic functionality. I'm not getting fancy about error checking,# parsing fields or putting any significant intelligence in. Adjust to taste.# uname: used for backup file naminguname=`uname -n`# timestamp: used for unique filenamestimestamp=`date +%y%m%d%H%M`# BUfilename: used as a destination filename.# default will look something like: wwapp0704171400.backupBUfilename="${UNAME.EN_US}${TIMESTAMP.EN_US}.backup"########### EDIT THESE VALUES FOR YOUR ENVIRONMENTBUproto="ftp://" # Possible values of (ftp|http|https)BUuser="anonymous:" # note the trailing ':' this is for [usernameassword] separationBUpassword="FTPpasswd@" # Note the trailing '@'. This is for [usernameassword@]server separationBUserver="192.168.56.4" # Enter address of the destination serverBUport=":21" # default for FTPBUdirectory="/webwasherbackup" # The destination directory. Note the leading '/'. This is for [/path]SSHuser="wwbackup" # Should be the CLI Administrative AccountSSHport="9092" # Default: 9092############ The resultant target URL that the configuration is pushed to should be in the format:# "(ftp|http|https)://[FTPuser:FTPpasswd@]server[ort][/path]/filename"# and Filesystem URLs like "[/path]/filename" are supported.BUurl="${BUPROTO.EN_US}${BUUSER.EN_US}${BUPASSWORD.EN_US}${BUSERVER.EN_US}${BUPORT.EN_US}${BUDIRECTORY.EN_US}/${BUFILENAME.EN_US}"SSHrun="backup ${BUURL.EN_US}"# Full ssh command line should look something like this:# ssh wwbackup@localhost -p 9092 "backup ftp://FTPuser:FTPpasswd@serverort/path/wwapp0704171400.backup"ssh ${SSHUSER.EN_US}@localhost -p ${SSHPORT.EN_US} "${SSHRUN.EN_US}"#### end of script[wwbackup@dmz-webgw1 bin]$

Re: ww6.8.7 Automatic Backup KB68022

These are linefeed characters and I don't know if you are seeing them explicitly in the output on your screen or if they are somehow being introduced only on this forum because of some strange pasting when you copy them to here?

Do you see the actual %0D on your system? If so, then you have some linefeeds in your script that you do not see, probably because of word wrap in your editor.

The linefeeds could be hidden and you cannot see them properly for many reasons. They could be artifacts of you pasting them from a PDF file. They could be hidden unicode characters somehow. I don't know.

When I copy a short script to a unix box like this, I open it all up in Notepad++ (sourceforge) and view hidden characters.

When running all the commands of the script in the shell the backup runs and the ftp transfer works. Maybe you can give us further help?

#!/bin/sh# ver. 1.0 - 04/17/2007 - erik_elsasser@securecomputing.com - e²# wwbackup.sh - Provides a scripted method of backing up the Webwasher appliance configuration# This script is invoked either from the command line or via a scheduled cron job# It is dependent on Webwasher's SSH administration being setup for public key authentication.# This script has very basic functionality. I'm not getting fancy about error checking,# parsing fields or putting any significant intelligence in. Adjust to taste.# uname: used for backup file naminguname=`uname -n`# timestamp: used for unique filenamestimestamp=`date +%y%m%d%H%M`# BUfilename: used as a destination filename.# default will look something like: wwapp0704171400.backupBUfilename="${uname}${timestamp}.bup"########### EDIT THESE VALUES FOR YOUR ENVIRONMENTBUproto="ftp://" # Possible values of (ftp|http|https)BUuser="anonymous:" # note the trailing ':' this is for [usernameassword] separationBUpassword="FTPpasswd@" # Note the trailing '@'. This is for [usernameassword@]server separationBUserver="192.168.56.4" # Enter address of the destination serverBUport=":21" # default for FTPBUdirectory="/webwasherbackup" # The destination directory. Note the leading '/'. This is for [/path]SSHuser="wwbackup" # Should be the CLI Administrative AccountSSHport="9092" # Default: 9092############ The resultant target URL that the configuration is pushed to should be in the format:# "(ftp|http|https)://[FTPuser:FTPpasswd@]server[ort][/path]/filename"# and Filesystem URLs like "[/path]/filename" are supported.BUurl="${BUproto}${BUuser}${BUpassword}${BUserver}${BUport}${BUdirectory}/${BUfilename}"SSHrun="backup ${BUurl}"# Full ssh command line should look something like this:# ssh wwbackup@localhost -p 9092 "backup ftp://FTPuser:FTPpasswd@serverort/path/wwapp0704171400.backup"ssh ${SSHuser}@localhost -p ${SSHport} "${SSHrun}"#### end of script

Re: ww6.8.7 Automatic Backup KB68022

These are linefeed characters and I don't know if you are seeing them explicitly in the output on your screen or if they are somehow being introduced only on this forum because of some strange pasting when you copy them to here?

Do you see the actual %0D on your system? If so, then you have some linefeeds in your script that you do not see, probably because of word wrap in your editor.

The linefeeds could be hidden and you cannot see them properly for many reasons. They could be artifacts of you pasting them from a PDF file. They could be hidden unicode characters somehow. I don't know.

When I copy a short script to a unix box like this, I open it all up in Notepad++ (sourceforge) and view hidden characters.