0

I read this question about loading Pig directories from a matched pattern, but I want to run a job that deletes in the same way. I have time-stamped directories i.e. /mydir/02-03-01, /mydir/02-03-02, /mydir/02-03-03 etc and want to delete say, 02-03-01 through 02-03-01. I tried

rmf /mydir/02-03-{01,02}/

With and without quotes to no effect. Any ideas?

Community
  • 1
  • 1
user1436111
  • 2,111
  • 7
  • 24
  • 41
  • You might want to consider using oozie to run your pig job. Oozie allows definition of datasets and also deletion of specific instances of these datasets before starting a job. – LiMuBei Mar 04 '15 at 16:45

1 Answers1

0

below one is working for me. it should be the first command in pig script.

   fs -rmr  -skipTrash  /user/root/mydir/02-03-{01,02};

-rmr is deprecated. you can also use this

    fs -rm -r   -skipTrash  /user/root/mydir/02-03-{01,02,03};  
sashoalm
  • 75,001
  • 122
  • 434
  • 781
Sravan K Reddy
  • 1,082
  • 1
  • 10
  • 19