Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # anos=(2016 2017 2018 2019)
- # meses=(02)
- meses=(01 02 03 04 05 06 07 08 09 10 11 12)
- anos=(2018)
- source="/volume1/NetBackup/Servers/MIA/"
- destination="/volume1/NetBackup/Servers/MIA/_Archive"
- ######## Pasar los Files del Primer dia del Año a Archiving
- for i in ${anos[@]}; do
- for j in ${meses[@]}; do
- month_start=$(date +$i-$j-01)
- month_finish=$(date +$i-$j-02)
- # echo $month_start
- # echo $month_finish
- path_array=(`find $source -type f -not -path "*/_Archive/*" -newermt $month_start ! -newermt $month_finish | cut -sd / -f 6-`)
- # echo $path_array
- # echo Archivos año: $i mes: $j
- #printf '%sn' "${path_array[@]}"
- done
- done
- printf '%sn' "${path_array[@]}"
Add Comment
Please, Sign In to add comment