Execution on cron does not work well

Hallo everyone, this is my first post here and I hope i will learn a lot from you guys.

I have the following command that somehow only works interactively, when I put the the following to the cron, it does not work.

It suppose to move file from one folder to another folder that's all.

/usr/bin/find /testcron/SessLogs -name "list.log.*" -exec /usr/bin/mv {} /testcron/SessLogs_archive \;

All the file list.log.* exists on this directory.

It works well when i submit manually and my other command works well when i put on cron.

Any advise is appreciated.
[/SIZE]

can you post your cron entry??

Does it give you any errors or it doesn't run at all? Have you specified the times correctly?

What does "does not work" mean?
What, exactly, does happen, if anything?
Do you get any error messages?
What is your crontab entry?

[indent]
When you post code, please wrap it in

 tags.



/usr/bin/find /testcron/SessLogs -name "list.log.*" -exec /usr/bin/mv {} /testcron/SessLogs_archive \;

All the file list.log.* exists on this directory.

It works well when i submit manually and my other command works well when i put on cron.
[/quote]

It runs, but it does not move all the files that was suppose to be found by find command.

cron logs shown succesful run, but none of the files are moved.

No probs on cron timing or entry. When you try to submit that command manually, it works fine, find command found the files and move to destination folder, somehow it doesn't when I put the command on cron.

when I try to run manually, I use the same account too so no access issues.

Any idea?

Does your cron uses the same SHELL that is used when you manually run the command. Meaning, are the PATH to the find and mv commands consistent. You may want to check on that.
It appears to me that either the find or the mv command is not able to execute it. Replace the mv command and only print the files found in the directory. see if that works atleast and you can diagonise the issue. All the best.

-Devaraj Takhellambam

Try putting the command into a script and then run the script from cron.

Thanks for all advise guys. At the end, I decide to put all command on the script and schedule this script into cron, it works fine now.