Em Andamento

Shell script

Hi,

I have a shell script that zips and then deleted file older than 14 days.

I can delete files older than 14 days but cannot restrict the zipping to older than 14 days.

I want you to simply give me a line of unix shell script that zips files (recursively through subfolder) _ BUT only files OLDER THAN 14 days.

Thanks

US

## Deliverables

#!/bin/sh

#Directory to backup path

# prject foler

directory=

#ftpdir =

#FTP information

ftpserver=ag2dchf04 #IP or hostname

username=

password=

#Backup file name

backupname=$(basename $directory)_$(date "+%Y-%m-%d")

#Zip the files

cd $(dirname $directory)

zip -r $backupname $(basename $directory) -i \*.idx -i \*.dat -i \*.txt

#Find and remove files oder than 7 days (remove only files with .txt and .csv extension)

find $directory -type f -name "*.dat" -mtime +14 -exec rm -f {} \;

find $directory -type f -name "*.idx" -mtime +14 -exec rm -f {} \;

find $directory -type f -name "*.txt" -mtime +14 -exec rm -f {} \;

#Do ftp upload

ftp -i -n $ftpserver <<ENDFTP

quote USER $username

quote PASS $password

binary

Habilidades: Engenharia, Gestão de projetos, Instalação de Script, Shell Script, Arquitetura de software, Teste de Software, Solaris

Ver mais: recursively, find unix, find binary, binary to txt, shell script extension, shell script or, shell script, sh, Rm, dat file idx file, shell unix, dat idx csv, shell script csv, delete file shell script, dat txt, script idx, zip backup, csv quote, idx dat files, backup script username, idx dat, script ftp upload, binary zip, shell script backup files, unix directory delete script

Acerca do Empregador:
( 67 comentários ) Australia

ID do Projeto: #3020088

Premiar a:

Bitquark

See private message.

$12 USD em 1 dia
(44 Avaliações)
5.9

6 freelancers are bidding on average $9 for this job

matfizvw

See private message.

$12.75 USD em 1 dia
(55 Comentários)
6.0
alinozlx

See private message.

$8.5 USD em 1 dia
(17 Comentários)
4.5
vw7893199vw

See private message.

$4.25 USD em 1 dia
(1 Comentário)
0.2
vkirovskiy

See private message.

$4.25 USD em 1 dia
(0 Comentários)
0.0
AnderSonB

See private message.

$12.75 USD em 1 dia
(0 Comentários)
0.0