Backup script with selective file types only


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Backup script with selective file types only
# 1  
Old 11-24-2015
Question Backup script with selective file types only

i am looking for a backup script to be run in ssh which can move all *.php files only to a archive

Eg. a folder has 5 sub folders with different file types, which can be mix of PDF, jpeg, gif etc etc.
but the archive generated should only include the *.php files without breaking the directory structure.

So once I upload the archive again after modification and extract, only php files of the folders within get replaced without breaking the path from which they were archived from.

I tried to grab all php files using FTP by setting up the filter but doesn't seem to work correctly.
# 2  
Old 11-24-2015
Try either:
Code:
find | grep \.php$
find ./ -name *.php

PS: If you want more, provide more (effort/script).

hth
# 3  
Old 11-25-2015
that would list it, but what I wanted to do is
create *.Tar backup of only specific file types

like a
jpeg.tar tarball should have files with only jpeg.tar
php.tar would have only *.php included and would skip other files.
# 4  
Old 11-25-2015
Check the -T option on the tar command.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script to find file types and info

I'm looking for a way to inventory files on a webserver into a CSV file, and am particularly interested in certain types of files, like .php, .cgi, .pl, .py, .sh, etc. but also want the ability to find all files, including those with no extension, or specified extensions, as above, including files... (1 Reply)
Discussion started by: spacegoose
1 Replies

2. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All, I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60% Need to identify the unique file system that reaches threshold value. ex: capacity ... (4 Replies)
Discussion started by: sasikanthdba
4 Replies

3. Shell Programming and Scripting

Help with Backup Shell Script for Network Device Configuration backup

HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here Im explaining the requirement of script. AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
Discussion started by: saichand1985
4 Replies

4. Shell Programming and Scripting

Selective Output for my Script

Hey everyone, I have a very simple BASH shell script that simply checks what processes I have running on a few different nodes, which are preknown. Currently, my script spews out all the processes on all the nodes, but I'm really only interested in one process per node. The processes I am ... (5 Replies)
Discussion started by: Stuart Ness
5 Replies

5. Shell Programming and Scripting

Need help in creating file restoration script from a backup script.

Hi all i am struggling in creating a restore of env files while doing applications clone. the first file i created for copying the important configurations file which is running perfect now for reverting the changes i mean when i am restoring these files to its original places i have to do... (7 Replies)
Discussion started by: javeedkaleem
7 Replies

6. Shell Programming and Scripting

sed/awk script selective insert between lines

Hi I have a file in the foll. format *RECORD* *FIELD NO* ....... ....... *FIELD TX* Data *FIELD AV* Data *FIELD RF* *RECORD* *FIELD NO* ....... ....... *FIELD TX* Data *FIELD RF* (4 Replies)
Discussion started by: dunstonrocks
4 Replies

7. Shell Programming and Scripting

Shell Script backup a file ?

could you please find a solution for this script that backup a file. The file name to backup should be provided as input parameter, the backup file should have the same file name with the extension ".bak". If the user provides no input parameter, the script should display an error message. If... (1 Reply)
Discussion started by: anything
1 Replies

8. UNIX for Dummies Questions & Answers

backup types

can anyone explain me difference between tar and ufsdump commands.............and also i wd like to know the difference between incremental and differential backup......... thx in advance (1 Reply)
Discussion started by: girish_shukla
1 Replies

9. Filesystems, Disks and Memory

Using `tar` for a selective backup.

Hi all & anyone. I'm trying to selectively backup up some old Apache log files before they are removed from the system (Slackware box). Have created a file listing of what I want backed up ...Below is a portion of the file ./selectedbkup... (2 Replies)
Discussion started by: Cameron
2 Replies
Login or Register to Ask a Question