fix move_archives
This commit is contained in:
parent
bcc5b0562c
commit
81a1db39e3
@ -30,7 +30,8 @@ fi
|
|||||||
|
|
||||||
DateCriteria="${Days} days ago"
|
DateCriteria="${Days} days ago"
|
||||||
|
|
||||||
TargeHost=cloudstore.cvtt.vpn
|
TargetHost=cloud21.cvtt.vpn
|
||||||
|
TargetRootDir=/opt/store/cvtt/archive
|
||||||
|
|
||||||
Oldest=$(date -d "${DateCriteria}" '+%Y-%m-%d')
|
Oldest=$(date -d "${DateCriteria}" '+%Y-%m-%d')
|
||||||
Now=$(date '+%Y%m%d_%H%M%S')
|
Now=$(date '+%Y%m%d_%H%M%S')
|
||||||
@ -53,7 +54,7 @@ if [ "$files" == "" ]
|
|||||||
then
|
then
|
||||||
echo "No files found older than ${Oldest} in ${ArchiveDir}"
|
echo "No files found older than ${Oldest} in ${ArchiveDir}"
|
||||||
else
|
else
|
||||||
Target="${TargetHost}:/home/cvtt/Archive/${FromHost}/"
|
Target="${TargetHost}:${TargetRootDir}/${FromHost}/"
|
||||||
echo "Moving files to ${Target}:"
|
echo "Moving files to ${Target}:"
|
||||||
echo -----------------
|
echo -----------------
|
||||||
for f in ${files}
|
for f in ${files}
|
||||||
@ -66,7 +67,7 @@ else
|
|||||||
Cmd="${Cmd} $files"
|
Cmd="${Cmd} $files"
|
||||||
Cmd="${Cmd} ${Target}"
|
Cmd="${Cmd} ${Target}"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
# exit
|
# exit
|
||||||
eval ${Cmd}
|
eval ${Cmd}
|
||||||
fi
|
fi
|
||||||
echo Done ${0} ${*}
|
echo Done ${0} ${*}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user