LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell Script for Identifying the file and zip all files, move the files to Target Dir (https://www.linuxquestions.org/questions/linux-newbie-8/shell-script-for-identifying-the-file-and-zip-all-files-move-the-files-to-target-dir-879351/)

gvenkat 05-07-2011 10:37 AM

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.

TB0ne 05-07-2011 10:41 AM

Quote:

Originally Posted by gvenkat (Post 4349292)
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.

r3sistance 05-07-2011 10:43 AM

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.

jv2112 05-07-2011 10:53 AM

man

-tar
-find
-cron

:study:


All times are GMT -5. The time now is 12:56 PM.