There are two files one is shell script (sample.sh) and another is configuration file (sampl_conf.cfg)
configuration file contains one variable $FTP_HOME. the value of this variable vaires for user to user. If user is say jadoo then value is /home/jadoo/ftp/, for user1 - /home/user1/ftp. The value can be seen at command prompt by typing "echo $FTP_HOME".
In shell script $FTP_HOME variable is used to find out some old file in that path (/home/jadoo/ftp).
Shell scripts reads the configuration file line by line and assing $FTP_HOME variable to another variable say "path"
Code:
#!/bin/sh........... path=`echo $LINE | cut -d" " -f1` duration=`echo $LINE | cut -d" " -f2` filename=`echo $LINE | cut -d" " -f3` path="$path"path=`eval echo $path` if [ "$filename" != "" ] ; then `find $path/$filename -type f -mtime $duration >> $tmpfile;`
Now find should search mentioned file for specific duration in $FTP_HOME directory, but it unable to replace the $FTP_HOME variable by its value.
below error displays on terminal
find: stat() error /log*: No such file or directory
Sample configuration file
Code:
$FTP_HOME +15 log*
Shell script is called through crontab
Please help me on this. thanks in advance.