Monday, June 29, 2009

Deleting Old files Using Find Command and copying files

Testing you can run this command

find /opt/test/ -mtime +2 -type f -exec ls -l {} \;



find /opt/test/ -mtime +2 -type f -exec rm -f {} \;

find (Destination) -mtime(How many Days Old) -type f(This restricts to regular files) -exec (to run command) rm -f (command to delete files)

Deleting files with .log extension

find . -name '*log*'  -mtime +5 -exec rm -f {} \;


find . -mtime -1 -type f -exec cp -r {} /tmp/files_to_move \;  copying multiple contents.



No comments:

curl and cacert

curl -v --cacert cacert.pem https://www.example/cgi-bin/f ile.xgi -I -X POST