Sponsored Content
Top Forums Shell Programming and Scripting Find big file include current date Post 302902517 by mzainal on Wednesday 21st of May 2014 10:14:18 PM
Old 05-21-2014
I know how to tar and split. But maybe you not read earlier post. I already told you, i want this bash script on crontab. It's mean it collect all data by running deamon.

If by manual, of course it's more easier. I can put all directory this have size more 100MB. And split them after put in tar.gz.

This script i want to put on cron and it's will run everyday. Seek new folder that have size more 100MB.

Our system have using that upload movie, document. The movie usually more that 100MB size.

The system also create directory and subdirectory. So we want to transfer big folder to other server that located on DC B, far away from our DC A.

Both DC connected using point-to-point fiber optic. It's mean not going to cloud or what ever public line. More than to dedicated line.

If i want to run manually, i will not asking expert here to do scripting. We have so many subdir. If using manually, it waste time. We want to reduce time, seek manually big folder.

---------- Post updated 05-21-14 at 09:14 PM ---------- Previous update was 05-20-14 at 10:59 PM ----------

From list folder below:
Code:
drwxrwxrwx 3 wwwrun  www     3896 May 20 15:36 LY2014000411
drwxrwxrwx 3 wwwrun  www     3896 May 20 15:42 LY2014000412
drwxrwxrwx 3 docuflo users   3896 May 20 15:54 AR2014000564
drwxrwxrwx 4 wwwrun  www     3896 May 20 17:00 LY2014000407
drwxrwxrwx 3 docuflo users   3896 May 20 17:00 LY2014000565
drwxrwxrwx 3 docuflo users   3896 May 20 17:00 LY2014000563
drwxrwxrwx 3 docuflo users   3896 May 20 17:38 LY2014000402
drwxrwxrwx 4 wwwrun  www     3896 May 20 17:39 LY2014000403
drwxrwxrwx 4 wwwrun  www     3896 May 20 17:51 LY2014000415
drwxrwxrwx 5 wwwrun  www     3896 May 21 09:50 LY2013000576
drwxrwxrwx 3 wwwrun  www     3896 May 21 12:28 LY2013000581
drwxrwxrwx 3 wwwrun  www     3896 May 21 12:43 LY2013000582
-rwxrwxrwx 1 root    root   16756 May 21 14:50 larger_than_100M.list
drwxrwxrwx 3 wwwrun  www     3896 May 21 14:59 AR2013001068
drwxrwxrwx 3 wwwrun  www     3896 May 21 15:07 AR2013001067
drwxrwxrwx 3 wwwrun  www     3896 May 21 15:17 AR2013001065
drwxrwxrwx 3 wwwrun  www     3896 May 21 15:21 AR2013001066
drwxrwxrwx 3 wwwrun  www     3896 May 21 15:34 FM2013000427

How to grep a date May 21 in bash script? List is directory. And i want to transfer using scp protocol.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to find files less than the current date

Hai, i have one directory contains 100 files .each file name like xvb_dateformat.i want find which file names are xvb_lessthan or equal to currentdate. any one give the solution. regards (4 Replies)
Discussion started by: mallikarjuna
4 Replies

2. Shell Programming and Scripting

Perl: Extracting date from file name and comparing with current date

I need to extract the date part from the file name (20080221 in this ex) and compare it with the current date and delete it, if it is a past date. $file = exp_ABCD4_T-2584780_upto_20080221.dmp.Z really appreciate any help. thanks mkneni (4 Replies)
Discussion started by: MKNENI
4 Replies

3. Shell Programming and Scripting

How to find a date which is 7 days past when given current date

hii all. I have to get the date of the 7th day past from the current date. if i give the current date as sep 3 then i must get the date as 27th of august. can we get the values from the "cal" command. cal | awk '{print $2}' will this type of command work. actually my need is if today is... (17 Replies)
Discussion started by: ladtony
17 Replies

4. Shell Programming and Scripting

How to find the create time of a file if current date is in next month

Hi All, I want to find the time diffrence between currnt time and "abc.txt" file create time. I have solve that but if the abc.txt file created last month then is there any process to find the difftent? Exp: Create time of abc.txt is "Apr 14 06:48" and currect date is "May 17 23:47".... (1 Reply)
Discussion started by: priyankak
1 Replies

5. UNIX for Advanced & Expert Users

In ksh find out the timestamp of current date?

Normally we can use %s to find out the time in second since 1970. But in my ksh, this format option is not available. Example- date +%s 1268103151 above script command won't work in ksh. Can you guys provide its equivalent ? (3 Replies)
Discussion started by: boy18nj
3 Replies

6. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

7. Shell Programming and Scripting

Get file name which include the current date

Hi, I'm trying to get the name of a file that has the current date in the name. The filename is on the form A<current date>01.DC, for example A2012110501.DC I have this script so far date +%y%m%d D=$(date +%y%m%d) N=A20$D echo $N N2={$N}01.DC echo $N2 And gets the following... (12 Replies)
Discussion started by: Immelstorn
12 Replies

8. Shell Programming and Scripting

Find the file created on current date

Hi All, I'm trying to find a file which is created on current day.... I searched in unix.com and i found, below command. find /land/ -mtime -1 -type f -print | grep "FF_Member_STG.dat" The command checks if the file with name "FF_Member_STG.dat" is created today then exit else proceed. ... (3 Replies)
Discussion started by: ace_friends22
3 Replies

9. UNIX for Beginners Questions & Answers

“sed” replace date in text file with current date

We want to call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ Code: line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to write a... (3 Replies)
Discussion started by: pradeepp
3 Replies

10. UNIX for Beginners Questions & Answers

Replace date in file every day with current date

I Have text like XXX_20190908.csv.gz need to replace Only date in this format with current date every day Thanks! (1 Reply)
Discussion started by: yamasani1991
1 Replies
DBI::ProxyServer(3)					User Contributed Perl Documentation				       DBI::ProxyServer(3)

NAME
DBI::ProxyServer - a server for the DBD::Proxy driver SYNOPSIS
use DBI::ProxyServer; DBI::ProxyServer::main(@ARGV); DESCRIPTION
DBI::Proxy Server is a module for implementing a proxy for the DBI proxy driver, DBD::Proxy. It allows access to databases over the network if the DBMS does not offer networked operations. But the proxy server might be usefull for you, even if you have a DBMS with integrated network functionality: It can be used as a DBI proxy in a firewalled environment. DBI::ProxyServer runs as a daemon on the machine with the DBMS or on the firewall. The client connects to the agent using the DBI driver DBD::Proxy, thus in the exactly same way than using DBD::mysql, DBD::mSQL or any other DBI driver. The agent is implemented as a RPC::PlServer application. Thus you have access to all the possibilities of this module, in particular encryption and a similar configuration file. DBI::ProxyServer adds the possibility of query restrictions: You can define a set of queries that a client may execute and restrict access to those. (Requires a DBI driver that supports parameter binding.) See "CONFIGURATION FILE". The provided driver script, dbiproxy(1), may either be used as it is or used as the basis for a local version modified to meet your needs. OPTIONS
When calling the DBI::ProxyServer::main() function, you supply an array of options. (@ARGV, the array of command line options is used, if you don't.) These options are parsed by the Getopt::Long module. The ProxyServer inherits all of RPC::PlServer's and hence Net::Daemon's options and option handling, in particular the ability to read options from either the command line or a config file. See RPC::PlServer(3). See Net::Daemon(3). Available options include chroot (--chroot=dir) (UNIX only) After doing a bind(), change root directory to the given directory by doing a chroot(). This is usefull for security, but it restricts the environment a lot. For example, you need to load DBI drivers in the config file or you have to create hard links to Unix sockets, if your drivers are using them. For example, with MySQL, a config file might contain the following lines: my $rootdir = '/var/dbiproxy'; my $unixsockdir = '/tmp'; my $unixsockfile = 'mysql.sock'; foreach $dir ($rootdir, "$rootdir$unixsockdir") { mkdir 0755, $dir; } link("$unixsockdir/$unixsockfile", "$rootdir$unixsockdir/$unixsockfile"); require DBD::mysql; { 'chroot' => $rootdir, ... } If you don't know chroot(), think of an FTP server where you can see a certain directory tree only after logging in. See also the --group and --user options. clients An array ref with a list of clients. Clients are hash refs, the attributes accept (0 for denying access and 1 for permitting) and mask, a Perl regular expression for the clients IP number or its host name. See "Access control" below. configfile (--configfile=file) Config files are assumed to return a single hash ref that overrides the arguments of the new method. However, command line arguments in turn take precedence over the config file. See the "CONFIGURATION FILE" section below for details on the config file. debug (--debug) Turn debugging mode on. Mainly this asserts that logging messages of level "debug" are created. facility (--facility=mode) (UNIX only) Facility to use for "Sys::Syslog (3)". The default is daemon. group (--group=gid) After doing a bind(), change the real and effective GID to the given. This is usefull, if you want your server to bind to a privileged port (<1024), but don't want the server to execute as root. See also the --user option. GID's can be passed as group names or numeric values. localaddr (--localaddr=ip) By default a daemon is listening to any IP number that a machine has. This attribute allows to restrict the server to the given IP num- ber. localport (--localport=port) This attribute sets the port on which the daemon is listening. It must be given somehow, as there's no default. logfile (--logfile=file) Be default logging messages will be written to the syslog (Unix) or to the event log (Windows NT). On other operating systems you need to specify a log file. The special value "STDERR" forces logging to stderr. See Net::Daemon::Log(3) for details. mode (--mode=modename) The server can run in three different modes, depending on the environment. If you are running Perl 5.005 and did compile it for threads, then the server will create a new thread for each connection. The thread will execute the server's Run() method and then terminate. This mode is the default, you can force it with "--mode=threads". If threads are not available, but you have a working fork(), then the server will behave similar by creating a new process for each connection. This mode will be used automatically in the absence of threads or if you use the "--mode=fork" option. Finally there's a single-connection mode: If the server has accepted a connection, he will enter the Run() method. No other connections are accepted until the Run() method returns (if the client disconnects). This operation mode is usefull if you have neither threads nor fork(), for example on the Macintosh. For debugging purposes you can force this mode with "--mode=single". pidfile (--pidfile=file) (UNIX only) If this option is present, a PID file will be created at the given location. user (--user=uid) After doing a bind(), change the real and effective UID to the given. This is usefull, if you want your server to bind to a privileged port (<1024), but don't want the server to execute as root. See also the --group and the --chroot options. UID's can be passed as group names or numeric values. version (--version) Supresses startup of the server; instead the version string will be printed and the program exits immediately. CONFIGURATION FILE
The configuration file is just that of RPC::PlServer or Net::Daemon with some additional attributes in the client list. The config file is a Perl script. At the top of the file you may include arbitraty Perl source, for example load drivers at the start (use- full to enhance performance), prepare a chroot environment and so on. The important thing is that you finally return a hash ref of option name/value pairs. The possible options are listed above. All possibilities of Net::Daemon and RPC::PlServer apply, in particular Host and/or User dependent access control Host and/or User dependent encryption Changing UID and/or GID after binding to the port Running in a chroot() environment Additionally the server offers you query restrictions. Suggest the following client list: 'clients' => [ { 'mask' => '^admin.company.com$', 'accept' => 1, 'users' => [ 'root', 'wwwrun' ], }, { 'mask' => '^admin.company.com$', 'accept' => 1, 'users' => [ 'root', 'wwwrun' ], 'sql' => { 'select' => 'SELECT * FROM foo', 'insert' => 'INSERT INTO foo VALUES (?, ?, ?)' } } then only the users root and wwwrun may connect from admin.company.com, executing arbitrary queries, but only wwwrun may connect from other hosts and is restricted to $sth->prepare("select"); or $sth->prepare("insert"); which in fact are "SELECT * FROM foo" or "INSERT INTO foo VALUES (?, ?, ?)". AUTHOR
Copyright (c) 1997 Jochen Wiedmann Am Eisteich 9 72555 Metzingen Germany Email: joe@ispsoft.de Phone: +49 7123 14881 The DBI::ProxyServer module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. In particular permission is granted to Tim Bunce for distributing this as a part of the DBI. SEE ALSO
dbiproxy(1), DBD::Proxy(3), DBI(3), RPC::PlServer(3), RPC::PlClient(3), Net::Daemon(3), Net::Daemon::Log(3), Sys::Syslog(3), Win32::Event- Log(3), syslog(2) perl v5.8.0 2002-12-01 DBI::ProxyServer(3)
All times are GMT -4. The time now is 03:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy