Have error messge when mv files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Have error messge when mv files
# 1  
Old 03-09-2017
Have error messge when mv files

I have three files on the directory

Code:
 dailytba=daily_tba_position.${Today}
dailypol=daily_pool_position.${Today}
let=LET.${Today}

When I do the following:
Code:
 if [ "${dailytba}" = "daily_tba_position.${Today}" ]
then
        sftp_file=DB.DAILY.DAILYTBA.${ACCTNMGRP}.${Today}.${TM}
        sftp_ind=${sftp_file}.ARD.ind
        sftp_ard=${sftp_file}.ARD
        touch ${sftp_ard}
        sftp_out=${sftp_file}.ARD.out
        mv ${dailytba} ${sftp_out}
fi
  
 
if [ "${dailypol}" = "daily_pool_position.${Today}" ]
then
        sftp_file=DB.DAILY.DAILYPOL.${ACCTNMGRP}.${Today}.${TM}
        sftp_ind=${sftp_file}.ARD.ind
        sftp_ard=${sftp_file}.ARD
        touch ${sftp_ard}
        sftp_out=${sftp_file}.ARD.out
        mv ${dailypol} ${sftp_out}
fi
  
 if [ "${let}" = "LET.${Today}" ]
then
        sftp_file=DB.DAILY.LET.${ACCTNMGRP}.${Today}.${TM}
        sftp_ind=${sftp_file}.ARD.ind
        sftp_ard=${sftp_file}.ARD
        touch ${sftp_ard}
        sftp_out=${sftp_file}.ARD.out
        mv ${let} ${sftp_out}
fi

I am getting a message:

Code:
 mv: cannot rename daily_tba_position.20170309 to DB.DAILY.DAILYTBA.MBSSB_MBSSBGROUP.20170309.102439.ARD.out:
No such file or directory
daily_tba_position.20170309 not found
mv: cannot rename daily_pool_position.20170309 to DB.DAILY.DAILYPOL.MBSSB_MBSSBGROUP.20170309.102439.ARD.out:
No such file or directory
daily_tba_position.20170309 not found
mv: cannot rename LET.20170309 to DB.DAILY.LET.MBSSB_MBSSBGROUP.20170309.102439.ARD.out:
No such file or directory

at the same time in the same script the following is working good
Code:
 if [ "${letday}" = "LET_daily_trans_${Today}.csv" ]
then
        sftp_file=DB.DAILY.LETDAY.${ACCTNMGRP}.${Today}.${TM}
        sftp_ind=${sftp_file}.ARD.ind
        sftp_ard=${sftp_file}.ARD
        touch ${sftp_ard}
        sftp_out=${sftp_file}.ARD.out
        mv ${letday} ${sftp_out}
fi

Could you please let me know why?
I am working on AIX and using Bourne shell
I definitely know that files are on the directory

Thanks for contribution
# 2  
Old 03-09-2017
I tend to believe system's error messages. Please post the directory listing of your current working directory when running the script.
# 3  
Old 03-09-2017
RudiC,
I don't understand, what you mean

---------- Post updated at 11:09 AM ---------- Previous update was at 11:08 AM ----------

The problem is that I cannot create *ARD.out file

---------- Post updated at 11:27 AM ---------- Previous update was at 11:09 AM ----------

I am working on directory
Code:
 /xxxx/xxxx/xxxx/sh/myscript.sh

Files directory is
Code:
/xxxxx/xxxxx/xxxxx/cool/cool_${Today}/daily

Before I work with file's rename I
Code:
 cd /xxxxx/xxxxx/xxxxx/cool/cool_${Today}/daily

# 4  
Old 03-09-2017
I'd suggest adding set -x to the top of the script and see what comes out of the execution.
Most likely the src/dst files of the mv either are not derived the way you *think* they should be OR they/src don't exist in the direct you *think* they exist.
# 5  
Old 03-09-2017
The problem is this one. I tar and gzip files on remote server

Code:
 find . -ctime -1 | tar -cvf transfer_dmz_start_daily.tar *${Today}*.*;

Command
Code:
find . -ctime -1

Doesn't find files without extention
Code:
.csv .txt

I have to collect all files for current day, when the program starts at 11:30 PM EST

Could you please help with this?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Error in looping through files

Hi, I've got a folder with several files I'd like to manipulate. The file names are all ending in .txt and I'd like to loop through their names for manipulation. This is the script I've got so far: for i in 'ls *.gtc.txt|cut -d "." -f1'; do echo${i}; done It should be easy enough, but... (2 Replies)
Discussion started by: zajtat
2 Replies

2. Shell Programming and Scripting

Error files count while coping files from source to destination locaton as well count success full

hi All, Any one answer my requirement. I have source location src_dir="/home/oracle/arun/IRMS-CM" My Target location dest_dir="/home/oracle/arun/LiveLink/IRMS-CM/$dc/$pc/$ct" my source text files check with below example.text file content $fn "\t" $dc "\t" $pc "\t" ... (3 Replies)
Discussion started by: sravanreddy
3 Replies

3. UNIX for Dummies Questions & Answers

Ftp files error

Hi Guys, I am trying to copy files using FTP but I get this error: Arguments to long... I read that I can copy files in batches...How can I copy those files in batches? I am currently using mget A*.csv B*.csv C*.csv, etc up to a certain letter then when its done i will continue. Is... (1 Reply)
Discussion started by: Phuti
1 Replies

4. Linux

Ambiguous redirect error and syntax error when using on multiple files

Hi, I need help on following linux bash script. When I linux commands for loop or while loop on individual file it runs great. but now I want the script to run on N number of files so it gives me ambiguous redirect error on line 12 and syntax error on line 22 : (pls help ); #!/bin/bash #... (16 Replies)
Discussion started by: Madhusudan Das
16 Replies

5. Solaris

Error copying files

I have installed Solaris 10 on a Sunblade 150 (512 MB RAM) successfully. But when I create a new directory and try to copy a 40 MB file to it it stops after about 37 MB and gives an error "I/O error" while copying. I have 40GB of Hard Disk. What is the problem? (8 Replies)
Discussion started by: mickod
8 Replies

6. Solaris

Error while zipping files

I was trying to remove & archive all the files in the current directory and embed them into the zip file, i mean i don't want to list the files any more after zipping those files. For this i wrote the following code though operation was succeeded zipping all the files and creating a zip file i am... (2 Replies)
Discussion started by: Ariean
2 Replies

7. UNIX and Linux Applications

Exim mail messge error

i have a exim mail server for mms to emails ,the mails are delivering to all the Domains,except the company one.(our own email id's) When ever we send it to our internal email it says 2008-10-31 14:01:07 1Kvs21-0002zW-00 == samson.isa@gloworld.com T=remote_smtp defer (-44): retry time not... (0 Replies)
Discussion started by: satish.res
0 Replies

8. UNIX for Advanced & Expert Users

getting error while copying files

I am trying copy all files ,i was getting below error .Please any idea #find . -name "*bat" -exec cp -p {} /devt/jobs find: incomplete statement Thanks, Akil (9 Replies)
Discussion started by: akil
9 Replies

9. Shell Programming and Scripting

ftp + pop up messge

Hi , Please give your valuable suggestion for my following query. I need to generate a pop up message when a cronjob fails. The cron job is in the load server and I need to show the pop up message in another web server. That is the output file(a.out) of the cron job file needs to be... (3 Replies)
Discussion started by: elavv
3 Replies

10. Shell Programming and Scripting

Error While Purging Files

find /filearchive/ -type f -mtime +7 -exec rm weblogs*.log {} \; This worked only if this comand is executed int he unix comand prompt, but when i put this in the shell script it is not recognizing the file.It says weblogs: No such file or directory Am i doing anything wrong here ? (4 Replies)
Discussion started by: svishh123
4 Replies
Login or Register to Ask a Question