0

If there exist a directory,

/backup/ And the files in it are a.gz b.gz c.gz

And another directory /backup-directorybackup And the files in it are a.gz

I need a shells script to compare two directories if the files are present then ignore it and if the filesare not present copy it to the destination directory

Thanks..

Hulk
  • 32,860
  • 62
  • 144
  • 215

2 Answers2

2

"rsync" command has it all

zed_0xff
  • 32,417
  • 7
  • 53
  • 72
2

rsync -a /backup/ /backup-directorybackup/

Paul R
  • 208,748
  • 37
  • 389
  • 560