shell scripting help
i am writing this shell script which logs in remotely to my squid server checks the log file if its 7 days old, if it exist then copy it to my machine to run a utility on the logfile
this is the script it #!/bin/bash # this script copies the access log file from the squid server copies it to 10.200.2.93 runs the sarg utility and the resulted report is sent back to server at /media/usbdisk/sarg_logs locate=$(ssh -l root 10.200.2.28 | dir=/media/usbdisk/squid/access/ | file=$(find $dir -daystart -mtime 8)| echo $file) #sarg -l $file i can successfully login to the server but cannot check for the file and copy it to my machine can someone help me |
First rule of scripting: Try the commands first in interactive mode to make sure you know how they work.
In this case, I don't think you are using the pipe (|) correctly. A pipe is used to feed the output of a command to another command which is expecting input. |
I asked my brother who is much better in coding than me and he told me that the script should look like this
Quote:
|
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
http://www.linuxquestions.org/questi...ys-old-802803/ |
All times are GMT -5. The time now is 12:54 PM. |