I'm teaching a class where (~80) students are submitting assignments that I can access via webdav, organized by student in directories named by their unique identifier.

The students are split into two groups that submit assignments on different days of the week. I'd like to create a bash script to automatically download files for each subset of students into a local directory.

What I don't know how to do is the following:

  1. Select a specific subset of folders by name to copy files from.
    • Edited based on comments: The webdav server I connect to has 80 directories named by student, these 80 directories are made up of two groups of students.
    • I would like to select files from directories in each group, i.e., Group1 contains directories StudentA/ StudentC/ StudentD/. Group 2 would contain the directories StudentB/ StudentE/ StudentF/.
  2. Specify the beginning date/time of files to be copied. End date/time would be useful to since I take deductions for late assignments.

Any help on either of these would be appreciated.

  • "Select a specific subset of folders by name to copy files from." is not a programming problem in the first place. You must know how you select this subset. Then you can tell us that and we may tell you how to script that. Commented Feb 20, 2014 at 20:52
  • @HaukeLaging Thanks for the feedback; I modified my original statement to be more clear.
    – chasely
    Commented Feb 20, 2014 at 20:58

1 Answer 1


"Specify the beginning date/time of files to be copied."

This is for find.

find StudentA/ StudentC/ StudentD/ -type f \
  -newermt 2014-02-19T00:00:00 -not -newermt 2014-02-19T23:59:59
  • Thanks for the tip. To clarify, I don't have a ./group1 subdirectory. The problem with selecting the student groups is I don't have the permissions to make subdirectories. The -newermt works perfectly though.
    – chasely
    Commented Feb 20, 2014 at 21:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .