Sponsored Content
Top Forums Shell Programming and Scripting How to copy all structure folder create last day? Post 303026524 by fajar_3t3 on Thursday 29th of November 2018 12:49:53 AM
Old 11-29-2018
How to copy all structure folder create last day?

HI All,


please help , i got same case . i want copy folder and directory create yesterday.


for sample below :


Code:
drwxr-xr-x 4 apps apps    33 Nov 23 04:00 xxxxxx@gmai.com
drwxr-xr-x 4 apps apps    33 Nov 23 04:00 yyyyyyy@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 24 04:00 aaaaaa@yahoo.com
drwxr-xr-x 4 apps apps    33 Nov 24 04:00 bbbbbbb@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 24 04:00 ccccccccc@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 24 20:01 dddddd@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 24 20:03 eeeeeee@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 26 13:10 fff@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 26 13:10 gggggg@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 27 04:00 hhhhhh@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 28 04:00 iiiiiii@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 29 04:00 jjjjj@gmail.com

pwd
Code:
/home/doc/user


and i want copy all folder directory create yesterday but actually in structure directory have some folder create different date like sample below :


pwd
Code:
/home/doc/user/jjjjj@gmail.com/doc



Code:
ls -ltr
total 0
drwxr-xr-x 2 apps apps 34 Oct 17 15:15 ID
drwxr-xr-x 2 apps apps 34 Oct 17 15:15 CARD

and i want copy all folder create yesterday include structure directory...


i already try with this command below but not spesified name folder got for yesterday create :

Code:
find /home/doc/user/ -mtime -1 -exec ls -ltr {} \;


please help , thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Auto copy for files from folder to folder upon instant writing

Hello all, I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written. I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies

2. Shell Programming and Scripting

File Management: How do I move all JPGS in a folder structure to a single folder?

This is the file structure: DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg DESKTOP/Root of Photo... (4 Replies)
Discussion started by: guptaxpn
4 Replies

3. Shell Programming and Scripting

Find all text files in folder and then copy to a new folder

Hi all, *I use Uwin and Cygwin emulator. I´m trying to search for all text files in the current folder (C/Files) and its sub folders using find -depth -name "*.txt" The above command worked for me, but now I would like to copy all found text files to a new folder (C/Files/Text) with ... (4 Replies)
Discussion started by: cgkmal
4 Replies

4. Shell Programming and Scripting

Concatenating Files In A Year/Month/Day File Structure

Hi Im trying to concatenate a specific file from each day in a year/month/day folder structure using Bash or equivalent. The file structure ends up like this: 2009/01/01/products 2009/01/02/products .... 2009/12/31/products The file I need is in products everyday and I need the script to... (3 Replies)
Discussion started by: Grizzly
3 Replies

5. Shell Programming and Scripting

Copy only folder structure ?

Hello, I am not sure how feasible is it, but trying to copy/create the folders from one box to another. I dont want to copy the content of folder otherwise it'd be too much of data.. The folder structure is quite complex (in deep hierarchy) and its a big effort manually .. Please... (5 Replies)
Discussion started by: navsha
5 Replies

6. Shell Programming and Scripting

Copy a file by creating folder structure in destination as in Souce

Hello, i am having a source directory which consist of multiple sub directories and my destination folder is a empty directory. if try to copy a file source->test->1.txt from source to destination test2 using the commaind. cp source/test/1.txt desti/ It will copy the 1.txt under desti... (1 Reply)
Discussion started by: tsaravanan
1 Replies

7. Shell Programming and Scripting

IMAPSYNC - trouble to create mailbox folder structure

Hi, I have installed ImapSync on Linux Debian. I tried run command to copy from Server A to Server B. It's run but imapsync doesn't create mailbox folder structure. I don't know if there is a command to force creation of mailbox's folders and subfolder. My command is below imapsync --host1... (0 Replies)
Discussion started by: symonx80
0 Replies

8. Shell Programming and Scripting

Move files & folder structure

Hey, this might be a really basic question, but I'm new to Unix scripting. I'm trying to find a command to replicate a file structure from one location to another & move the actual files contained in the base directories, i.e. I have this structure - home/temp/test/dir1/ ... (3 Replies)
Discussion started by: SOCLA_CELT
3 Replies

9. Shell Programming and Scripting

Getting the Folder Structure in Unix

Hi All, I have a compute box and I want to tar directory structure under a directory and then Deploy/untar it in a new compute box so that the directory structure will be exactly the same. I do not want any of the file to be extracted and deployed but instead only the directory structure. ... (2 Replies)
Discussion started by: filter
2 Replies

10. Shell Programming and Scripting

Script to create folder, copy file, and send email on success

I am very new to UNIX as well as scripting so please be gentle, haha. I have a Linux client which has a mount point mapped to my /etc folder on a NetApp FAS system. I woudl like to be able to copy the hosts and rc files once a week from the FAS to a different location for backup. When the... (4 Replies)
Discussion started by: minnino
4 Replies
rt-email-dashboards(8)					     Request Tracker Reference					    rt-email-dashboards(8)

NAME
rt-email-dashboards - Send email dashboards SYNOPSIS
rt-email-dashboards [options] DESCRIPTION
This tool will send users email based on how they have subscribed to dashboards. A dashboard is a set of saved searches, the subscription controls how often that dashboard is sent and how it's displayed. Each subscription has an hour, and possibly day of week or day of month. These are taken to be in the user's timezone if available, UTC otherwise. SETUP
You'll need to have cron run this script every hour. Here's an example crontab entry to do this. 0 * * * * /usr/bin/perl /opt/rt4/local/sbin/rt-email-dashboards This will run the script every hour on the hour. This may need some further tweaking to be run as the correct user. OPTIONS
This tool supports a few options. Most are for debugging. -h --help Display this documentation --dryrun Figure out which dashboards would be sent, but don't actually generate or email any of them --time SECONDS Instead of using the current time to figure out which dashboards should be sent, use SECONDS (usually since midnight Jan 1st, 1970, so 1192216018 would be Oct 12 19:06:58 GMT 2007). --epoch SECONDS Back-compat for --time SECONDS. --all Ignore subscription frequency when considering each dashboard (should only be used with --dryrun for testing and debugging) perl v5.14.2 2013-05-22 rt-email-dashboards(8)
All times are GMT -4. The time now is 11:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy