LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-25-2016, 11:52 PM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
Why can't compress files into target directory?


Code:
pwd
/home/debian8
rar a  /tmp/imitation.rar  /home/imitation

RAR 4.20   Copyright (c) 1993-2012 Alexander Roshal   9 Jun 2012
Trial version             Type RAR -? for help

Evaluation copy. Please register.

ERROR: Bad archive /tmp/imitation.rar

rar a  imitation.rar  /home/imitation

ls  /home/debian8
imitation.rar
rar command can compress files into current directory.
Code:
rar a  imitation.rar  /home/imitation
#execute
rar command can't compress files into target directory,
Code:
rar a  /tmp/imitation.rar  /home/imitation
#can't execute
Why?
 
Old 11-26-2016, 01:36 AM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
Tried rar with three different forms:
  1. Archive into a directory by listing individual files to archive.
  2. Archive into a directory by listing directory whose contents I wish to archive.
  3. Archive into /tmp by listing directory whose contents I wish to archive.

All three forms, worked, here's the output:

Code:
prompt> rar a bard/archive.rar a b c

RAR 5.40   Copyright (c) 1993-2016 Alexander Roshal   15 Aug 2016
Trial version             Type RAR -? for help

Evaluation copy. Please register.

Creating archive bard/archive.rar

Adding    a                                                           OK 
Adding    b                                                           OK 
Adding    c                                                           OK 
Done
prompt> rar a bard/archive.rar da_files

RAR 5.40   Copyright (c) 1993-2016 Alexander Roshal   15 Aug 2016
Trial version             Type RAR -? for help

Evaluation copy. Please register.

Updating archive bard/archive.rar

Adding    da_files/b                                                  OK 
Adding    da_files/c                                                  OK 
Adding    da_files/a                                                  OK 
Adding    da_files                                                     0%
Done
prompt> rar a /tmp/archive.rar da_files

RAR 5.40   Copyright (c) 1993-2016 Alexander Roshal   15 Aug 2016
Trial version             Type RAR -? for help

Evaluation copy. Please register.

Creating archive /tmp/archive.rar

Adding    da_files/b                                                  OK 
Adding    da_files/c                                                  OK 
Adding    da_files/a                                                  OK 
Adding    da_files                                                     0%
Done
It might help if you could show us the actual attempts to execute the rar command, along with any output from each attempt, including any error-messages/complaints from the rar command.
 
1 members found this post helpful.
Old 11-26-2016, 04:34 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
maybe the file /tmp/imitation.rar already exists?
 
Old 11-26-2016, 04:37 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Or there is insufficient disk space for the output?
 
  


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
Compress several files without directory structure srg46srg Linux - Newbie 1 12-04-2012 07:01 AM
using tar to compress specific files in a directory named a certain way slinky66 Linux - Newbie 3 11-25-2009 01:31 PM
tar doesn't compress .hidden files in the same directory it is run in? BassKozz Linux - Newbie 2 06-02-2009 04:46 PM
Can tar restore only files newer than already in target directory? lhouk Linux - General 4 08-31-2006 01:19 PM
Shell: Tar files: programmatically determining the name of the target directory stefanlasiewski Programming 3 08-17-2005 08:48 PM

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

All times are GMT -5. The time now is 02:48 PM.

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
Open Source Consulting | Domain Registration