linux - Compressing multiple cpanel account into separate .tar.gz files -
my whm incremental backup remote server. question how can compress directories separate file , move different folder. example
main_dir ---account1 ---account2 ---account3
the second directory should have this
sec_dir ---account1.tar.gz ---account2.tar.gz ---account3.tar.gz
i want create cronjob compress account in main_dir move them sec_dir
thx
you can use below command compression
change directory main_dir
cd main_dir
tar -cvzf fullpathto/sec_dir/account1.tar.gz account1
or
for in
ls fullpath-of-main_dir
; nice -n 19 /bin/tar -cvzf fullpath-of-sec_dir/$i.tar.gz fullpath-of-main_dir/$i; done
ls dir in ' ' commas. mean use ' in starting , in last ls fullpath-of-main_dir
Comments
Post a Comment