Automatic Archiving or Zip

Taking care of your Linux box.
sonn33
Naik
Posts: 57
Joined: Wed Aug 25, 2004 3:20 pm
Location: Philippines
Contact:

Automatic Archiving or Zip

Postby sonn33 » Mon Mar 30, 2009 3:15 pm

Hi Guys,

I would like to know if possible that I can schedule automatic archiving or automatic zip on my specific folder. I am using Centos OS.

Thanks in advance.

Sonn
sonn33

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Mon Mar 30, 2009 10:52 pm

write a script to do the zip/tar/whatever, run it through cron.
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

x2oxen
Major General
Posts: 1114
Joined: Wed Aug 22, 2007 3:17 pm
Location: Faisalabad
Contact:

Postby x2oxen » Wed Apr 01, 2009 10:25 am

Yup make a bash script to do so and then add its cron job as per your requirement.
Muhammad Usman
+92-321-6640501
Chemonics International
http://usmanpk.com

sonn33
Naik
Posts: 57
Joined: Wed Aug 25, 2004 3:20 pm
Location: Philippines
Contact:

Postby sonn33 » Fri Apr 03, 2009 7:58 am

Hi.

I am sorry but I know its insane =) can you please tell me a a little bit of a script or a site I am really not familiar writing script.

Thank you,
sonn
sonn33

x2oxen
Major General
Posts: 1114
Joined: Wed Aug 22, 2007 3:17 pm
Location: Faisalabad
Contact:

Postby x2oxen » Fri Apr 03, 2009 2:03 pm

Code: Select all

#!/bin/sh

DIR=/root/usman
TAR=/usr/bin/tar
PATH=/root/backup/usman.tgz

$TAR -cvzf $PATH $DIR


Above script is a little sample which will take the backup of directory /root/usman in the folder /root/backup with the filename usman.tgz. This will compress the files as well with Gunzip and Tar
Muhammad Usman

+92-321-6640501

Chemonics International

http://usmanpk.com


Return to “Administration”

Who is online

Users browsing this forum: No registered users and 1 guest