user3112259
user3112259

Reputation: 1

placing log files in different folders based on month and day

This is a homework question. I have a shell script in which i am creating a folder structure .Then i am giving a call to java program where i am extracting data from a table writing it into the file and want to place the file to that folder. The folder structure changes everyday. as let suppose the folder structure like Logs/Month/day and i am creating that everyday. How can i place the data file to the particular folder.

Ex. I have a_20131216.log to be placed in logs/12/16 a_20131215.log to be placed in logs/12/15

Upvotes: 0

Views: 245

Answers (1)

glenn jackman
glenn jackman

Reputation: 246827

Look at

  • the date command to create the directory name.
  • the -p option to mkdir

Upvotes: 1

Related Questions