If you're trying to tidy up the remote system, the problem you have there is that FTP is a File Transfer(!) Protocol, not a File Sharing one, so you can't use any old cmd (eg find), you can only use those provided internally by ftp http://linux.die.net/man/1/ftp.
Normally, I'd use a combo of scp (or sftp) to do file txfr, then ssh to do remote work. |
hmm running as root not a really good idea.
also i think i found my typo. try it with /test/ instead of just test/ i typically use this to clean up log files. so mine looks like the following: Code:
find ${HOMEDIR}/logs/*.log -mtime +30 -exec rm -rf '{}' \; |
Shouldn't there be a space between the dir to start from and the file pattern
Code:
find ${HOMEDIR}/logs '*.log' -mtime +30 -exec rm -rf '{}' \; |
no need for the space, but the '*.log' is probably a good idea. not sure why i didnt do it there when i did later on with the {}
the path for my log files in $HOME/logs/foo.log, thus the $HOMEDIR/logs/*.log in my find command. i will modify my script to place the ' ' around the wildcard though Code:
find ${HOMEDIR}/logs/'*.log' -mtime +30 -exec rm -rf '{}' \; |
No: to get a sane list returned find requires a dirpath as the 'where to start' param and then you'd need -name (or -iname) to specify the file pattern to search for
Code:
find ${HOMEDIR}/logs -name '*.log' -mtime +30 -exec rm -rf '{}' \; |
oh, now thats new to me. thank you. ill read up on that.
|
All times are GMT -5. The time now is 09:43 PM. |