What I'm trying to do is figure out how to ftp a set of random files each day about 50 or so maybe more or less.
I have a folder on my server that gets about 1000 or so new files each day, each with today's date in the file name. We just want to take a sample each day for quality checks.
eg. testnumberssomethingelse20071121morenumbers
What I need to do is grab 50 random files for today's date and upload them via ftp. I have all the code for ftp and what not, I just don't know how to pick out 50 or so files out of 1000+ and direct them to my ftp process.
Here is my current script without randomization, which I've gather mostly from here.
1) List the filenames to a file
2) Use rand(no. of filenames in the file)
3) Use the result of the rand() as the position of the filename list in the file.
4) Get the filename to ftp
Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom.
I create a named pipe then:
dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024
but when I cat a file to the fifo that's 1024 random bytes:
cat randomfile.txt >... (7 Replies)
I just need to see any number of random files to see the owner, group and permissions information since all the files in the directory have the same permissions and ownership information. Is it possible just to list any 5 files without going thru the series of commands such as "ls -ltu | head -5"... (8 Replies)
Hi,
I have 200 pictures in a folder and I would like move 10 random pictures every week to given folder automatically.
I have this server on 1and1.com.
So I tried the following using Bash script for manual copy and paste for testing
#!/bin/bash
mapfile -t -n 3 files < <(find... (13 Replies)
Hi
I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue:
I want expect script for random passwords and random commands generation.
please can anyone help me?
Many Thanks in advance (0 Replies)
I have a script that generates a file which is my own incarnation of a date using the 'date' function (we'll call this script a). I would like that script to invoke my other script (script b) which contains my ftp info. Since I have yet to figure out a good way to use regular ftp (yes i can only... (6 Replies)
Hello member's
I'm learning to script in the ksh environment on a Solaris Box.
I have 10 files in a directory that I need to pass, as input to a batch job one by one. lets say, the files are named as follows:
abcd.txt ; efgh.bat ; wxyz.temp etc. (random filenames with varied extensions ).... (1 Reply)
Hi ,
We are facing a weird problem in our project. we need to send some xml & audio files to a remote FTP server from a Linux box, we are doing this in Perl script using Net::FTP->. Issue here is.. when FTPed the files using Perl scripts, only empty files ( 0 byte) are getting created on the... (2 Replies)
The following script is used to loop through files in the /tmp directory and transfer those files onto another server.
However, some of the files do not transfer. It is very random when the transferring is done (i.e. one of the files won't transfer then next time, that one will transfer and... (1 Reply)
Hi
I have a question.
In the FTP script if we are passing all the required value like Hostname, username, password, Action(put or get), Filename, & mode(ascii or binary) through parameters then we have to pass these in the exact orders in which they are taken like if we defined Username=$2... (2 Replies)