Your script should work if you remove the quote marks. However may I suggest something like this. For your crontab entry (assuming your shell script file is in /root/bin and called getpic.sh) use:
00,30 * * * * /root/bin/getpic.sh <Site URL of file to get> <filename>
For your script use:
cd <path to where you want to store files>
mv $2 $2.`date +%s`
Now you have a script you can use on multiple sites with multiple files. The date +%s inside the grave marks (to the left of the 1 below the tilde on most keyboards) will execute the date command and return a large integer and the actual file should show the date created.
%s seconds since 1970-01-01 00:00:00 UTC
Then you don't have to worry about them being in the correct order in your directory listing or trying to figure out what year, month, day or time they were created. Hope that makes sense and works ok.
Edited 5 Years Ago by rch1231: removed extra asterick in cron entry
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...