Team i am trying to delete files which are older than 1 day from 1 path (assuming already files are existed ) .
From another path we are trying to move files .like below .While executing this i m getting this error .
mv: cannot stat `/backup/db_backups/FULL/*': No such file or directory
But i am sure / backup/db_backups/FULL folder is existed and its bash ..
Any suggessions ??
evn rm command ran for the first time properly but 2nd iteration onwords its not removing files though we have older files
#PURGE OLD BACKUPS from /backup_LOCAL/db_backups
cd /backup_LOCAL/db_backups/FULL/
find /backup_LOCAL/db_backups/FULL -mtime +1 -exec rm -rf {} \;
# MOVE BACKUPS TO backup_LOCAL/db_backups FROM /backup/db_backups/
cd /backup/db_backups/FULL
mv /backup/db_backups/FULL/*.* /backup_LOCAL/db_backups/FULL/
mv: cannot stat `/backup/db_backups/FULL/*': No such file or directory
This occurs when the shell can not expand the * to any meaningful file name. It is not complaining about the directory FULL not existing but about * not being a file.
If all files matching that pattern has been moved or deleted previously, the shell does not have any to expand later on and it passes the * to the command.