Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.5k
  • 205
  • 1.8k
  • 2.3k
Source Link

tar unix not changing directory

I am executing a tar command to compress files which are present in another directory.

I executed following command:

tar -czf /backupmnt/abc.tar.gz -C /backupmnt/statusService/ *

I want to create abc.tar.gz file in /backupmnt which should include all files in /backupmnt/statusService/ directory, but I am getting below error:

tar: components: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

components is present in current directory from where I am executing the command. Below are the contents of /backupmnt/statusService

SS-01:/ # ls /backupmnt/statusService
MJ.netact.xml.tar.gz      gmoTemp_fm.tar.gz  mr.properties.tar.gz  probe.properties.tar.gz  relay_logs.tar.gz  ss_logs.tar.gz  tomcat_conf.tar.gz
esymac_config.txt.tar.gz  gmoTemp_pm.tar.gz  o2ml.tar.gz           probes_logs.tar.gz       ss_conf.tar.gz     ss_pm.tar.gz    tomcat_logs.tar.gz

I am not able to get where I am wrong.