Finds all files over 10MB in size under /path and presents their names and size in a human readable format:
find /path -size +10M -exec du -h {} \;
find /path -size +10M -exec du -h {} \;
#!/usr/bin/bash
LOCKFILE=/tmp/ftp_mirror.lock
if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then
exit # already running
fi
HOST="ftphost"
USER="username"
PASS="password"
LCD="localpath"
RCD="remotepath"
# make sure the lockfile is removed when we exit and then claim it
trap "rm -f ${LOCKFILE}; exit" INT TERM EXIT
echo $$ > ${LOCKFILE}
# upload files
lftp -c "set ftp:list-options -a;
open ftp://$USER:$PASS@$HOST;
lcd $LCD;
cd $RCD;
mirror --reverse"
rm -f ${LOCKFILE}