Zipping and moving


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Zipping and moving
# 8  
Old 09-28-2011
itkamaraj is trying to help you and asked a question for further information. Since neither itkamaraj nor any other user here (I assume) has any magic capabilities that would make them have a look at your code through your eyes. So help yourself by answering those people that try to help you. If you keep ignoring them and just ask a new question before answering the previous, do not expect to become further help.

Also what was not clear from the commands suggested so far? If you continue to just ask questions without answering previous or do not show own effort in using the hints given so far, I will set your status to read-only for this forum.
This User Gave Thanks to zaxxon For This Post:
# 9  
Old 09-28-2011
error in command

Hi itkamaraj,

the error for u r command (find /home/499633/scripts -iname "*.txt" -mtime -3| xargs tar -cvzf /test/backup.tgz) that u were discussing is ...

xargs invalid option --c
# 10  
Old 09-28-2011
Code:
find /home/499633/scripts -iname "*.txt" -mtime -3| xargs tar -cvzf /test/backup.tgz

i missed the tar command. check your syntax again
# 11  
Old 09-28-2011
error saying...

Hi,

Thanks a lot...but now upon executing this on cywgin..it is in output showing error ...
command not found...any idae wats d prblm..??
# 12  
Old 09-28-2011
please always "post the exact error message" and what you tried.

unless, its very hard to assume and tell what is wrong
# 13  
Old 09-28-2011
execution on 2 nd time

I have also tried executing by ./ne1.sh .....now the file is executed but the error is ...
Code:
tar: cowardly refusing to create an empty archive

wats d reason for that any guesses..!!

---------- Post updated at 10:09 AM ---------- Previous update was at 09:51 AM ----------

Hi,

Thanks a lot now the command is working ..the command finally is ....
Code:
find /home/Administrator/files -iname "*.txt" -mtime -3| xargs tar -cvzf /home/Administrator/output/backup.tgz

I am really thankful to you...but only the prblm is that when i go the output folder ..I see the tar backup..but when i unrar it thru win rar i got the complete folder structure lyk home then administrator and then finally the files but i want when my tar file unzipped it should directly contain file names only,,,!! any idea how to solve this..!!

Last edited by Scott; 09-28-2011 at 12:24 PM.. Reason: Code tags
# 14  
Old 09-28-2011
Code:
mkdir /tmp/myfiles
find /home/Administrator/files -iname "*.txt" -mtime -3 | while read file
do
  cp $file /tmp/myfiles
done

tar -cvzf myfile.tgz /tmp/myfiles

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Zipping

Good Morning, I'd like to archive an old user's files in the home directory on Solaris 9 Will this work? cd home tar -zcvf jsmitharchive.tar.gz jsmith/ ---------- Post updated at 09:37 AM ---------- Previous update was at 09:33 AM ---------- Also- is the last /necessary (after... (4 Replies)
Discussion started by: Stellaman1977
4 Replies

2. Shell Programming and Scripting

Help with grouping and zipping

Hi can you please help with the below ? source file: Column1,Column2,Column3,Column4 abc,123,dir1/FXX/F19,1 abc,123,dir1/FXX/F20,1 abc,123,dir1/FXX/F23,2 abc,123,dir1/FXX/C25,2 abc,123,dir1/FXX/X25,2 abc,123,dir1/FXX/A23,3 abc,123,dir1/FXX/Z25,3 abc,123,dir1/FXX/Y25,4 I want to... (3 Replies)
Discussion started by: paul1234
3 Replies

3. Shell Programming and Scripting

Zipping without extension

I currently have a code that find and zip all files in current folder and zip it, the problem is the name of the zip will include the extension as well and I don't want it. for ex: Volvo-red.swf -> Volvo-red.swf.zip find . -maxdepth 1 -type f ! -name ".*" -exec bash -c 'zip -r "$0.zip"... (6 Replies)
Discussion started by: Frozen77
6 Replies

4. Shell Programming and Scripting

Zipping files

Hi Guys, The script below works but it creates a zip folder under 123_arch.zip -- test1 -- orig1.txt -- orig2.txt -- orig3.txt -- orig4.txt I don't want the sub directory test1 but everything under the base *arch name I can not create a long name with... (4 Replies)
Discussion started by: GaryP1973
4 Replies

5. UNIX for Dummies Questions & Answers

Zipping the file when moving

Hi, I have a file a.txt, I am moving the file from my source location (/root/onw/src) to target folder(root/byl/src). My target folder has already a file by name a.txt..,while moving can I see if this file a.txt is existing then move it to archive folder(/root/byl/arc) zip and add time stamp to... (2 Replies)
Discussion started by: shruthidwh
2 Replies

6. Shell Programming and Scripting

Help with zipping files

Hi, I have come across a requirement in which I need to zip files. This is fine but the requriement has one conditions like below: One .z file can not have more than 10,000 files Now in the directory I have several files liek below: aaa_file_10_00001.txt aaa_file_10_00002.txt... (6 Replies)
Discussion started by: angshuman
6 Replies

7. Shell Programming and Scripting

zipping files

Dear Experts, I need a script which will zipped the files older than 2 days. but i dont want to use find . * -mtime 2. Is there is any other method to achive this task. i will ececute the script daily. Regards, (3 Replies)
Discussion started by: shary
3 Replies

8. UNIX for Dummies Questions & Answers

Zipping

Hi In unix i want to zip the files in a directory excluding *.dmp, *.log, *.lst, *.out files in that directory. pls let me know what command to use. $zip ........ ? Thanks (1 Reply)
Discussion started by: dreams5617
1 Replies

9. Shell Programming and Scripting

Zipping the dir

Hi, Ex: Directory /u01/par If a directory contains all the below files: a.lst b.lst c.lst d.lst ......etc i have 50 files in this directory. How to(command to) zip all the files in this directory into a single zip file. Thanks (1 Reply)
Discussion started by: dreams5617
1 Replies

10. UNIX for Dummies Questions & Answers

zipping across platforms

I saw a few posts on this, however, I am getting an error and don't see this particular issue. Not right off anyways.... We moved from digital OS to solaris 9 in Jan. On the old platform, I could gzip my files, ftp them to my win2000 desktop via hummingbird and then unzip them to view. Now,... (8 Replies)
Discussion started by: MizzGail
8 Replies
Login or Register to Ask a Question