Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ -d "$1" ]
- then
- x=( $(find $1 -mtime -1 -ls | tail -n +2 | cut -d ' ' -f 26) )
- len=${#x[@]}
- d=$(date '+%d')
- m=$(date '+%m')
- y=$(date '+%Y')
- #for i in ${x[@]}; do echo $i; done
- if [ -d "$2" ]
- then
- for i in ${x[@]}; do cp $i $2; done
- else
- mkdir ./$2
- for i in ${x[@]}; do cp $i $2; done
- fi
- for file in $2/* ;do mv $file ${file}_"$d"_"$m"_"$y" ; done
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement