Shell script
could you please give a help on writing a shell script that will move from folder1 to folder2 on an houlry basis and re_name the folders into folder2 as "%Y%m%d%hh24"`
|
What have you written so far?
|
Quote:
We will be happy to HELP you with a script, but we are not going to write it for you. There are MANY THOUSANDS of bash scripting tutorials you can find with a brief Google search. If you post what you have written yourself and tell us what you're stuck on/confused about, we will be happy to assist. |
#/bin/sh
cd . ./.profile cd /baksett/media/orgdata/backup today_hour=`date +"%Y%m%d%k"` mkdir $today_hour mv b*.dat /baksett/media/orgdata/backup/$today_hour cd /baksett/media/orgdata/backup/$today_hour ftp -ni 10.20.0.18 <<EOF user lio test binary mput b*.dat quit EOF >>>i got nothing for now |
Quote:
Try adding set -x as the second line of your script and then run it, that'll let you see each line as it's being processed, you may get a clue. |
in the newly created folder
|
Note using "%k" almost never makes sense (while "%H" does) and since you 'mv' files instead of using 'cp' there may be nothing left to move?..
To see what a script and subsequent commands actually do execute in verbose mode: Code:
#/bin/bash -vx |
i tried to put event the tags and i still don't get an ouput
Thx |
We can't read minds nor look at your terminal window: post complete output and between BB code tags.
|
I would try ftp command on local host. For testing
Code:
ftp ni localhost << EOF .. |
All times are GMT -5. The time now is 04:04 PM. |