LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-07-2011, 11:37 AM   #1
gvenkat
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: 0
Smile Shell Script for Identifying the file and zip all files, move the files to Target Dir


Pls help in providing the following requirement script...

1. Every Sunday

2. Find all files older than 1 day

3. Gzip these file

4. Tar up the gzipped files into one tar file.

5. Name the tarball with a date stamp indicating what day it was created, so we know that week's files are in the file

Thanks in advance.
 
Old 05-07-2011, 11:41 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,258

Rep: Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436
Quote:
Originally Posted by gvenkat View Post
Pls help in providing the following requirement script...

1. Every Sunday
2. Find all files older than 1 day
3. Gzip these file
4. Tar up the gzipped files into one tar file.
5. Name the tarball with a date stamp indicating what day it was created, so we know that week's files are in the file
Thanks in advance.
Spell out your words. And if you need HELP with a script, then post what you've written, and where you're stuck.

If you want someone to write it FOR you, sorry...we're not. There are thousands of bash scripting tutorials you can easily find with a quick Google search. Read the man pages for find and tar, and write your own script.
 
Old 05-07-2011, 11:43 AM   #3
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Erm, this could be worded MUCH better (both in how it is phrased and how it is asked)

Anyway, perhaps some more details would be in order? After all I am doubting you want EVERY file on a machine Gzipped every day... also what is the point behind this script? Presumably this is a back-up script, what is it's purpose and what is it intending to back-up? Because right now this is sounding too much like homework for my liking.

Also Questions 1 and 5 are just redundant, 1 wouldn't be handled by the script, you'd use something else tho I am not going to say it until I understand the scenario and 5 should already be obvious why that is redundant.
 
Old 05-07-2011, 11:53 AM   #4
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
man

-tar
-find
-cron

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Count files in dir then move that many files in a script? chuckycharms Linux - Newbie 3 12-18-2009 12:31 PM
shell script to move files from one system to another sytem with file names in a txt coral_km Linux - Newbie 3 02-13-2008 11:23 PM
Shell Script to save/restore files and dir permissions joangopan Fedora 1 09-09-2007 03:51 AM
Very simple shell script - move files to different directories beley Programming 7 11-02-2006 06:24 AM
Tar files in a dir modified before 7 days in a shell script jayachristina Linux - Newbie 4 05-14-2004 03:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration