file size-cron job


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting file size-cron job
# 1  
Old 07-31-2007
Question file size-cron job

Dear all,

I have the following case,, i need to transfer a group of file from one server to another ....when the size of any of these file reach a specified value (Ex: 10MB) i need to transfer it to another server ....my problem is that i dont know how to determine when the size of the file reach its maximum limit (10MB).............

I tried to use cron job with
SCP <filename> username@<ipaddress>:/directory

is there any way to determine when the size of file reach 10MB so i can start transfering it using scp command

Thanx

Regards
# 2  
Old 07-31-2007
Quote:
Originally Posted by mm00123
Dear all,

I have the following case,, i need to transfer a group of file from one server to another ....when the size of any of these file reach a specified value (Ex: 10MB) i need to transfer it to another server ....my problem is that i dont know how to determine when the size of the file reach its maximum limit (10MB).............

I tried to use cron job with
SCP <filename> username@<ipaddress>:/directory

is there any way to determine when the size of file reach 10MB so i can start transfering it using scp command

There are many ways to get the size of a file. The most portable is wc:

Code:
size=$( wc -c < FILENAME )

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Add TimeStamp to cron job and write file name sent

Hello, I have written a cron job to automate the sftp of files using key authentication. I wanted to add a timeStamp and name of file sent to a log file and append each these details to the same file each time files are sent and if possible include whether the files were sent successfully or not.... (3 Replies)
Discussion started by: KidKoder
3 Replies

2. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. Shell Programming and Scripting

Cron Job failure - No such file or directory

Hi all, I'm having an issue with a script i wrote to pull information from the Amazon AWS API. Basically the script takes arguments from the command line and attempts to grab user information for each AWS access group. The command is issued like this: # sh awsReport.sh <outputFileName>... (3 Replies)
Discussion started by: ChocoTaco
3 Replies

4. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

5. UNIX for Advanced & Expert Users

cron job to extact lines from files to another file and ftp to new server

i have a text file in this format: which creates a new one everyday in the form of filename _zing__r200_2012_8_10_log.txt Fri Aug 10 07:29:17 EDT 2012, usera(192.168.0.245) to anotheruser: hey top, this is a private test Fri Aug 10 07:29:28 EDT 2012, anotheruser(192.168.0.245) to usera: got... (2 Replies)
Discussion started by: bkkid
2 Replies

6. Shell Programming and Scripting

Running script file using cron job every 5 second

Hi All, I beginner in unix, i have no idea how to set the script file using cron job every 5 second. I also want to execute automatically the output to text file.This is my script name countsys.sh and my textfile abc.txt. (6 Replies)
Discussion started by: mastercar
6 Replies

7. Shell Programming and Scripting

Cron job to move file from one directory to another

Hi, I have following directory structure Media (Inside media directory I have two folders namely videos and images) -->videos -->images Inside media directory I have some video files with extension .mp4 and images with extension of .jpg and .jpeg I want to write a cron job which will... (3 Replies)
Discussion started by: tusharkale
3 Replies

8. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

9. UNIX for Dummies Questions & Answers

cron job to run php file

Hello, I have searched and searched google to do this and i want my websever to be able to run a php file everyday automatically. How do I go about doing this? Php is installed as an apache module not CGI. Thank you! (3 Replies)
Discussion started by: christo16
3 Replies

10. Shell Programming and Scripting

Conditional File Movement script scheduled using CRON job

Hi All, i am trying to automate a process and have to create a unix script like wise. I have a scenario in which i need to automate a file movement. Below are the steps i need to automate. 1. Check whether a file (Not Fixed name-Pattern search of file say 'E*.dat') is present in a... (2 Replies)
Discussion started by: imu
2 Replies
Login or Register to Ask a Question