Sponsored Content
Top Forums UNIX for Dummies Questions & Answers get all files under specified dir and zip them, then transfer to another machine Post 302428835 by crest.boy on Friday 11th of June 2010 04:43:32 AM
Old 06-11-2010
get all files under specified dir and zip them, then transfer to another machine

Hi guys,

now, I have the following requirement:

1. Get all files under specified directory
2. the files modify date should be specified date
3. zip these files
4. transfer these files to another machine, assume ip, user and password are given.

could you pls provide good solution for this? thanks a lot!
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unzip .zip file and list the files included in the .zip archive

Hello, I am trying to return the name of the resulting file from a .zip archive file using unix unzip command. unzip c07212007.cef7081.zip Archive: c07212007.cef7081.zip SecureZIP for z/OS by PKWARE inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00 I used the following command to unzip in... (5 Replies)
Discussion started by: oracledev
5 Replies

2. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

3. Shell Programming and Scripting

moving files from a dir in one machine to a dir in another machines

Hi, I am a unix newbie.I need to write a shell script to move my oracle READ WRITE datafiles from one serevr to another. I need to move it from /u01/oradata/W1KK/.. to /u01/oradata/W2KK, /u02/oradata/W1KK/.. to /u02/oradata/W2KK. That is, I actaully am moving my datafiles from one database to... (2 Replies)
Discussion started by: mathews
2 Replies

4. UNIX for Dummies Questions & Answers

How to transfer files from one machine to another?

Hello - I am wondering what would be a command to copy files from one machine to another unix machine? For example: I am currently logged into: beta-machine01 my current directory is: /home/router I want to copy file from machine: beta-machine02 the file is located inside:... (1 Reply)
Discussion started by: DallasT
1 Replies

5. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

6. IP Networking

How to transfer files from UNIX server to windows machine or vice versa using ftp or sftp commands?

hi, i want to write a shell script code which transfers files from a directory in unix server to a directory in a windows machine.. can any1 give me a sample code which uses ftp or sftp command.. thanks very much, (3 Replies)
Discussion started by: Little
3 Replies

7. Shell Programming and Scripting

Loop through the dir and Rename zip files and their underlying text file.

I have files in the ABC_YYYYMMDD.zip format under a directory. Each zip file contains A text file in the ABC_YYYYMMDD.txt format. I am trying to create a script that will Rename the zip files and their underlying text file replacing the datepart in them with . For eg: in the case of... (1 Reply)
Discussion started by: bash987
1 Replies

8. UNIX for Beginners Questions & Answers

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (2 Replies)
Discussion started by: b.saipriyanka
2 Replies

9. Shell Programming and Scripting

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (1 Reply)
Discussion started by: b.saipriyanka
1 Replies
ZIPARCHIVE.ADDGLOB(3)							 1						     ZIPARCHIVE.ADDGLOB(3)

ZipArchive::addGlob - Add files from a directory by glob pattern

SYNOPSIS
bool ZipArchive::addGlob (string $pattern, [int $flags], [array $options = array()]) DESCRIPTION
Add files from a directory which match the glob $pattern. PARAMETERS
o $pattern - A glob(3) pattern against which files will be matched. o $flags - A bit mask of glob() flags. o $options - An associative array of options. Available options are: o "add_path" Prefix to prepend when translating to the local path of the file within the archive. This is applied after any remove operations defined by the "remove_path" or "remove_all_path" options. o "remove_path" Prefix to remove from matching file paths before adding to the archive. o "remove_all_path" TRUE to use the file name only and add to the root of the archive. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 ZipArchive::addGlob example Add all php scripts and text files from current working directory <?php $zip = new ZipArchive(); $ret = $zip->open('application.zip', ZipArchive::OVERWRITE); if ($ret !== TRUE) { printf('Failed with code %d', $ret); } else { $options = array('add_path' => 'sources/', 'remove_all_path' => TRUE); $zip->addGlob('*.{php,txt}', GLOB_BRACE, $options); $zip->close(); } ?> SEE ALSO
ZipArchive::addFile, ZipArchive::addPattern. PHP Documentation Group ZIPARCHIVE.ADDGLOB(3)
All times are GMT -4. The time now is 08:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy