You are not logged in.
Pages: 1
Topic closed
What do you think would be the easiest way to write this script? Python?
Write a script to search the directory tree, starting from the directory given as first parameter, for
files with names that match a pattern given as second parameter and a size greater than or equal
to the value passed as the third parameter. For example,
$ mish /home *mov 1000kwould return all files from the /home directory that end with " mov" (movie mpeg4) and
are larger than or equal to 1 MB. As indicated, it should be possible to use * as a wildcard in the
file name. The shell script will save a log in /tmp/size.txt with information (accumulated and
sorted by file size) of the files found including at least (one line per file) name, path, size,
ownership, date.From the files found, the script will move to a directory (protected from reading, writing and
execution, except for "root") those belonging to local users (except "root") and that exceed in 3
KByte the size indicated in the third parameter. These files will be stored under /tmp/username
for each user individually (e.g. all files belonging to the user "john" will be stored in the
directory /tmp/john/ ). The script will send an email to each user informing of the files that have
been moved by the administrator.Finally, the script will schedule a task to be executed 48 hours later. This task will delete all the
files that were moved to /tmp/username (see description above). Note that if the script is run in
two consecutive days, on the third day it should only delete the files from the first run, but NOT
from the second one (which will be deleted on the fourth day).
Offline
That depends. How good are you at Python?
Offline
Please read the Forum Etiquette and don't ask for help with homework:
http://wiki.archlinux.org/index.php/For … e#Homework
Closing
Offline
Pages: 1
Topic closed