Welcome to Server Circle. It's a friendly site and all levels of experience are welcome. Be aware that we use cookies for your login.
Server Circle - Ask questions about Servers and get answers from experts.
Beta (0.95 sec)
REWARD: Simple home directory backup script

Can someone please help me to create a compressed file for three home directories ?

I know how to use tar and gzip but can't zip up three home directories in a script.

If I could run it in Cron and then download the file every day manually that would be great.

Thank you, I will give 100 of my points.
Asked by:
poppy
1375 points
 Report Abuse
 Share Page - Category: Shell Scripting - Tags: REWARD: Simple home directory backup script
 Enter your response
Please use Pastie.org to paste lengthy code or to fix formatting issues with code
  • Responses in reverse (4)

Best Answer

You can even make three file, but if you want only one file:

tar czf /pathwhereyouwant/backupfile.tgz /home/homedir1 /home/homedir2 /home/homedir3

After creation where you want to upload this file?


Response by:
leoncino
1280 points
You can type this

cd /home

tar cvf home-backup-date user[1-100]

or

find /home |cpio -i >/hdd/home-backup-date

Response by:
mohamad_kian
1548 points
Tar cvJf FULL_PATH_OF_BACKUP.bz2 home1 home2 home3

c=create

v=verbose

J=bzip2

f=file

target will be on FULL_PATH_OF_BACKUP.bz2

Response by:
jalal
3623 points
Ahh, I didn't know you could do that with tar.

I can actually put that in a script now - thank you. Points to you.

Response by:
poppy
1375 points


  • Related Questions
About Us : Contact Us : Etiquette : Terms : CDN Failover : ShorterURL : CDN Fallback : © 2013 Server Circle