I need script for file modify time check and if date older, file will be deleted and send report to my email : Read More
Tag: script
Shell script to watch the disk space
Find out the percentage of space:
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }'
Output:
71% /dev/hdb1 98% /dev/hdb5
Direct ssh access between two unix system/access two unix system without password
if [ -z “$1″ ]; then echo “usage: ssh-uploadkeys user@host” else if [ -e “$HOME/.ssh/id_dsa.pub” ]; then echo “SSH public key found: ~/.ssh/id_dsa.pub” else echo -e ‘\n\n’|ssh-keygen -t dsa -N ” fi cat ~/.ssh/id_dsa.pub| \ ssh $1 ‘cat > tero-authorized_keys && mkdir -p $HOME/.ssh/ && chmod 0700 $HOME /.ssh/ && cat tero-authorized_keys >> .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys && rm tero-authorized_keys && echo “Success, next time you do not need to type password.”||echo “SSH key generation or upload failed.”‘ fi