The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
WebDav/davfs mounted file & directory names in all UPPERCASE MrMoney UNIX for Dummies Questions & Answers 0 01-22-2009 05:08 PM
Grub Next Generation 0.1 (Upload Server branch) iBot Software Releases - RSS News 0 01-12-2009 02:50 PM
upload excel file contents to server magikminox Shell Programming and Scripting 1 06-30-2008 11:23 AM
stuck in perl cgi to upload a file to server sachin_kaw Shell Programming and Scripting 4 06-26-2005 09:36 AM
How to upload to the unix server? rdog157h UNIX for Dummies Questions & Answers 4 01-01-2005 09:50 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-25-2009
knut knut is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 2
upload file to webdav server

Hi all
i have a such question this is my shell script my script must upload file to webdav server
PHP Code:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
#!/bin/sh

### ----------------------------------------------------------------------- ###
### Get the current date string
### ----------------------------------------------------------------------- ###

   
CURRENT_DATE=`date "+%Y-%m-%d"`
   
#echo ${CURRENT_DATE}


    


### ----------------------------------------------------------------------- ###
### Configuration
### ----------------------------------------------------------------------- ###
SITE_NAME="blabla"
WEBDAV_NAME="blabla"
INTERFACE_NAME="blabla"

# Script Path
SCRIPT_PATH="xml_api/cci"
SCRIPT_FILE="extract_survey_data.php"

# Output Files
OUTPUT_FILE="${CURRENT_DATE}export.csv"

echo ${OUTPUT_FILE}

# Error Handling
ERROR_EMAIL_TO="some@email.com"
ERROR_EMAIL_SUBJECT="RNT to WSI Failure"

### ----------------------------------------------------------------------- ###
### fail function
### ----------------------------------------------------------------------- ###

function fail() {
    echo 
"${1}" mail -${ERROR_EMAIL_SUBJECT} ${ERROR_EMAIL_TO}
    echo 
"Failure: $1"
    
exit 1
}

### ----------------------------------------------------------------------- ###
### Run the php script
### ----------------------------------------------------------------------- ###

PATH_INFO=${SCRIPT_PATH}/${SCRIPT_FILE}
  
export PATH_TRANSLATED=$PATH_INFO
QUERY_STRING
=""
SCRIPT_NAME="/cgi-bin/${INTERFACE_NAME}.cfg/php"
REDIRECT_QUERY_STRING="${QUERY_STRING}"
REDIRECT_URL="${SCRIPT_NAME}/${PATH_INFO}"
REMOTE_ADDR=127.0.0.1
REQUEST_METHOD
=GET

if [ -"${QUERY_STRING}" ] ; then
    REQUEST_URI
="${REDIRECT_URL}?${QUERY_STRING}"
else
    
REQUEST_URI="${REDIRECT_URL}"
fi

echo ${PATH_INFO} ${QUERY_STRING} ${SCRIPT_NAME} ${REDIRECT_URL}

 
export PATH_INFO QUERY_STRING SCRIPT_NAME REDIRECT_QUERY_STRING REDIRECT_URL 
    REMOTE_ADDR REQUEST_METHOD 

### ----------------------------------------------------------------------- ###
### Replace this shell's process with PHP -- proper error reporting
### ----------------------------------------------------------------------- ###
if [ "$CHROOTED" ] ; then
    cd 
"/cgi-bin/${INTERFACE_NAME}.cfg"
    
exec ./php  
else
    
cd "/www/somename/${SITE_NAME}/cgi-bin/${INTERFACE_NAME}.cfg"
    
exec ./php
fi


### ----------------------------------------------------------------------- ###
### WebDAV the Files
### ----------------------------------------------------------------------- ###


env "HOME=/www/somename/${SITE_NAME}/priv_keys/" cadaver 
    
"https://hostingdocs.custhelp.com/fileserver/${WEBDAV_NAME}" << EOF
put 
/www/somename/${SITE_NAME}/tmp/${OUTPUT_FILE}
exit
EOF 
my shellscript create file in
/www/somename/${SITE_NAME}/tmp/ some file and after createing it must put created file in
https://hostingdocs.custhelp.com/fileserver/${WEBDAV_NAME}
but my problem is that puting file comand dose not work
please explein me what is wrong with my put command
thanks.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0