first commit
This commit is contained in:
13
ssh_loops/loop_array.sh
Normal file
13
ssh_loops/loop_array.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
#find only derctoris older then 10 days
|
||||
DIR_NAME=($(find /opt/backup/database/ -maxdepth 1 -type d -ctime +10))
|
||||
|
||||
for dir in "${DIR_NAME[@]}"
|
||||
do
|
||||
echo "tar -cvPf $dir.tgz $dir --remove-files"
|
||||
|
||||
done
|
||||
|
||||
|
||||
#this will tar and remove
|
||||
#tar -cvf /home/roy/Desktop/test/some_dir.tgz /home/roy/Desktop/test/some_dir --remove-files
|
Reference in New Issue
Block a user