Here is the error now:
/bin/sh: /var/chroot/home/content/c
: bad interpreter: No such file or directory
Main Topics
Browse All TopicsI am attempting to write a cron job that will move two files onto an sftp server, then create a directory with the date as its name, and move the files into the directory. So far I have the code below, but I am not familar with linux, cron jobs, or sftp so I am stuck. The code below produces the following error in go-daddy's cron manager:
/bin/sh: /var/chroot/home/content/c
: bad interpreter: No such file or directory
We are on a shared linux server and the cron manager says I use the following shell languages:
Your Shared Hosting account supports the following languages and associated interpreter lines:
Perl: #!/usr/bin/perl
Python 2.2: #!/usr/bin/python2.2
Python 2.3: #!/usr/bin/python2.3
Python 2.4: #!/usr/bin/python2.4
Ruby: #!/usr/local/bin/ruby
Bash: #!/bin/bash
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Here is the error now:
/bin/sh: /var/chroot/home/content/c
: bad interpreter: No such file or directory
Used this handy windows utility to covert file from dos2unix
http://www.bastet.com/
I will post the results from the cron job once it runs.
Passed the first hurdle, now I get this output
/var/chroot/home/content/c
/var/chroot/home/content/c
mv: cannot move `[output directory]/Output/[file name].xls' to `[output directory]Output/20080702/
mv: cannot move `[output directory]/Output/[file name].xls' to `[output directory]/Output/20080702
Couple of questions with that script.
Does the line ssh user@host "mkdir $OF" make the directory on the remote host? I want the directory on the local host, the remote host just needs to have both files coped to it
which leads to my 2nd question: where do I specify the password for the remote host. Since this is a shared server, I can not store a public/private key in /etc/ folder(I think that is where you put the key)
Long story short:
I need to 'push' the two files out to the remote host(using password authentication and sftp, not sure if the windows version of copssh supports scp) and then create a directory on the local host in the output folder named the date, and move the two files into that directory.
Am I on the right track?
Also looks like I can not use scp on my webserver:
/var/chroot/home/content/c
/var/chroot/home/content/c
/var/chroot/home/content/c
mv: cannot move `[output folder]/Output/online_paym
`[output folder]/Output/20080702/on
mv: cannot move `[output folder]/Output/online_paym
can you install perl modules on the local server?
you will need to have the Net::SFTP perl module installed.
I just wrote this for you... I cant test in my environment so it could have a couple of typos...
There are probably smarter ways to code this up but it should do what you need.
Let me know how it goes if you decide to try it.
Business Accounts
Answer for Membership
by: duncan_roePosted on 2008-07-02 at 13:24:49ID: 21920354
Change line 1 to #!/bin/sh and try again