ls /backup/db_backups/INCREMENTAL/|while read file ; do
mv $file /backup_LOCAL/db_backups/INCREMENTAL/
done
...but when I run this command using a bash script I'm getting this error
./test.sh
mv: cannot stat `1.0.db2inst2.DBPART000.20151119062453.001.gz': No such file or directory
mv: cannot stat `2.0.db2inst2.DBPART000.20151119062528.001.gz': No such file or directory
mv: cannot stat `3.0.db2inst2.DBPART000.20151119062540.001.gz': No such file or directory
mv: cannot stat `4.0.db2inst2.DBPART000.20151119061646.001.gz': No such file or directory
mv: cannot stat `5.0.db2inst2.DBPART000.20151119062518.001.gz': No such file or directory
mv: cannot stat `6.0.db2inst2.DBPART000.20151119062504.001.gz': No such file or directory
ls -l /backup_LOCAL/
drwxrwxr-x 4 db2inst2 db2iadm1 4096 Nov 12 04:52 backup_LOCAL
Is this some thing permission issue ? but I can move files to /backup_LOCAL mv command manually but not using bash .
# MOVE BACKUPS TO backup_LOCAL/db_backups FROM /backup/db_backups/
cd /backup/db_backups/INCRMENTAL/
#mv /backup/db_backups/INCRMENTAL/*.* /backup_LOCAL/db_backups/INCREMENTAL/
ls /backup/db_backups/INCREMENTAL/|while read file ; do
mv $file /backup_LOCAL/db_backups/INCREMENTAL/
done
content is here
ls -l /backup/db_backup/INCREMENTAL
-rw-r--r-- 1 db2inst2 db2iadm1 0 Nov 20 09:56 1.txt
-rw-r--r-- 1 db2inst2 db2iadm1 0 Nov 20 09:56 2.txt
-rw-r--r-- 1 db2inst2 db2iadm1 0 Nov 20 09:57 3.txt
I m really don't understand why this bash is not copying the files .THis is the error .
./Weekly_Full_Online.sh: line 34: cd: /backup/db_backups/INCRMENTAL/: No such file or directory
mv: cannot stat `1.txt': No such file or directory
mv: cannot stat `2.txt': No such file or directory
mv: cannot stat `3.txt': No such file or directory
Is there any problem with syntax ? i can move the content if use mv out side bash
mv: cannot create regular file `/backup_LOCAL/db_backups/FULL/': Is a directory
mv: cannot create regular file `/backup_LOCAL/db_backups/INCREMENTAL/': Is a directory
---------- Post updated at 11:46 AM ---------- Previous update was at 11:41 AM ----------
ignore it .i am working .let me share final out put .