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
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
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
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
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
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
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
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
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
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
LEARN ABOUT PHP
ziparchive.addglob
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)