I'm using Ubuntu Server 12.10 and I need to configure a cron job to delete some files in samba shares that belong to some criteria.
I'm configured some samba shares in /media/raid/. The folders are: process library users local
All these folders are specific samba shares with specific permissions. All of these folders have a sub-folder named .recycle that is used to store all deleted files in the shares.
What I need to do is to delete all files that are inside that shares (folders), in order to them go to the .recycle folder after they will be deleted, but I don't want to delete the files that have that same name in the .recycle folder.
The files are named '..rvt' where the first * is the file name and the second one is some numbers that auto increment, so that's the mask I need to use.
I have tried find command in multiple ways, but I always get the files inside .recycle folder.
I also need to assure that the files are removed like a user delete them, so they go to the .recycle directory.
Can you help???...