Automatic Archiving or Zip

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

Automatic Archiving or Zip

Post by sonn33 »

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:

Post by lambda »

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:

Post by x2oxen »

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:

Post by sonn33 »

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:

Post by x2oxen »

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
Post Reply