1

The logs for my cron job show the following:

Your "cron" job on

produced the following output: mv: cannot access *SRP* mv: cannot access 0001LO928365.CSE ... and so on. But the files did actually move to the desired location. What might be causing this error? Any help is appreciated!
manjug
  • 11
  • 2
  • My "guess" is that you move the directory containing the files before the move is applied to the individual files. How do you generate the list of what you are moving? – David C. Rankin Aug 20 '20 at 08:43
  • @DavidC.Rankin - I only need to move the files out - I'm archiving them (mv + gzip) in another folder as files to be processed for the day always come and sit in this directory. My query does this: cd $from_path mv /*.SRP*/ /*.CSE*/ /*SRP*/ /*CSE*/ /*.xml*/ $to_path (Apologies, I'm new here - I don't know how to print the * symbol in this comment so i added / before it ) – manjug Aug 20 '20 at 09:33

1 Answers1

0

Apologies - I figured this one out.

The move command is looking for different file types and moving all types. Even if the file is present, the command outputs an error stating file not found.

See testing details below:

root@abcd-abcdef:~/movetest/out# ls -lrt
total 5
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile1.CSE
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile2.CSE
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile3.CSE
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile4.CSE
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile5.CSE
root@abcd-abcdef:~/movetest/out# cd ../archive
root@abcd-abcdef:~/movetest/archive# ls -lrt
total 0
root@abcd-abcdef:~/movetest/archive# cd -
/home/specuser/movetest/out
root@abcd-abcdef:~/movetest/out# mv *.SRP* *.CSE* *SRP* *CSE* *.xml* ../archive/
mv: cannot access *.SRP*
mv: cannot access *SRP*
mv: cannot access testfile1.CSE
mv: cannot access testfile2.CSE
mv: cannot access testfile3.CSE
mv: cannot access testfile4.CSE
mv: cannot access testfile5.CSE
mv: cannot access *.xml*
root@abcd-abcdef:~/movetest/out# ls -lrt
total 0
root@abcd-abcdef:~/movetest/out# cd -
/home/specuser/movetest/archive
root@abcd-abcdef:~/movetest/archive# ls -lrt
total 5
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile1.CSE
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile2.CSE
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile3.CSE
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile4.CSE
-rw-r--r--   1 root     root           0 Aug 20 13:53 testfile5.CSE
root@abcd-abcdef:~/movetest/archive#*
manjug
  • 11
  • 2