Sponsored Content
Top Forums Shell Programming and Scripting Help Needed for creating the folder by checking today's date and, take backup using rsync command Post 303035941 by bakula10 on Monday 10th of June 2019 07:05:24 AM
Old 06-10-2019
Help Needed for creating the folder by checking today's date and, take backup using rsync command

How to create a shell script to create a folder by using the today's date to take backup using rsync command on every evening around 7 pm.
Kindly help.
Thanks.

To be more precise,
I want to create a script which matches the today's date with server's date format, if matches then creates the folder named date itself in the mentioned path "/tmp/test/files/testing/".
Moreover, after that it searches for the files which are created by today's date by using find command -newermt from some path, lets say "/var/www/path" and rsync command those files into /mnt/.

I'm kinda new shell scripter however, kindly help me with the script.

Thanks,
Bakula

Last edited by bakula10; 06-10-2019 at 08:40 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed on Date command

Hi, I am facing one problem with date command.Actually I want to use this command to get the last month,not the current month..OK,I can do current month - 1 and give special condition for january,But this time i need last month as strings like January,februaury,march etc... There is option... (5 Replies)
Discussion started by: nikunj
5 Replies

2. Shell Programming and Scripting

Backup of today's file

Hiii, Here is the part o fmy script- for file in $FileList do if ]; then echo "Skips $file file. It is todays file" if ];then cp $file $BackupLocation 2>/dev/null ... (3 Replies)
Discussion started by: namishtiwari
3 Replies

3. HP-UX

Backup Script using fbackup command Help Needed.

Hi Friends, I'm new to unix, I have the below script which takes regular backup. Now if fbackup fails I get the below messages in my log as fbackup(3047): could not open output file /dev/rmt/0m fbackup(3019): would you like to enter a new output file? fbackup(3004): writer aborting... (4 Replies)
Discussion started by: avik.nandi
4 Replies

4. UNIX for Dummies Questions & Answers

Shell Scripts - shows today’s date and time in a better format than ‘date’ (Uses positional paramete

Hello, I am trying to show today's date and time in a better format than ‘date' (Using positional parameters). I found a command mktime and am wondering if this is the best command to use or will this also show me the time elapse since 1/30/70? Any help would be greatly appreciated, Thanks... (3 Replies)
Discussion started by: citizencro
3 Replies

5. Shell Programming and Scripting

how to use WGET command to get today's date?

I need to get the current date off a remote site, such as Google or Yahoo. Does anyone know how to use the wget command on a Solaris 10 system to do this? I recall a long time ago, where using "wget" will get a bunch of info off a site, and then, you can extract the date from all of that info. ... (6 Replies)
Discussion started by: newbie09
6 Replies

6. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

Hi Everyone, we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment? Thanks in adv. (0 Replies)
Discussion started by: MVEERA
0 Replies

7. UNIX for Dummies Questions & Answers

date command option e Help needed please!!

Hi All, I was trying to get the date in format "Feb2" I tried option "e" giving me a padded space and getting the result as "Feb 2". Though its working fine for dates 10 to 31. Please suggest me how to get rid of this space before date. Thanks Olivia (4 Replies)
Discussion started by: Olivia
4 Replies

8. Shell Programming and Scripting

[Solved] Replace yesterday date with today's date except from the first line

Hello, I have a file like this: 2012112920121130 12345620121130msABowwiqiq 34477420121129amABamauee e7748420121130ehABeheheei in case the content of the file has the date of yesterday within the lines containing pattern AB this should be replaced by the current date. But if I use... (3 Replies)
Discussion started by: Lilu_CK
3 Replies

9. Shell Programming and Scripting

UNIX date fuction - how to deduct days from today's date

Hi, One of my Unix scripts needs to look for files coming in on Fridays. This script runs on Mondays. $date +"%y%m%d" will give me today's date. How can I get previous Friday's date.. can I do "today's date minus 3 days" to get Friday's date? If not, then any other way?? Name of the files is... (4 Replies)
Discussion started by: juzz4fun
4 Replies

10. Shell Programming and Scripting

Need to add a date column (today's date) in file

Hi I have file with number status and date1 and date1 field, want add a column today between column date1 and date2. file1.txt number status date1 date2 ===== ==== === ===== 34567 open 27/06/13 28/06/13 45678 open 27/06/13 28/06/13 43567 open 27/06/13 28/06/13 ... (1 Reply)
Discussion started by: vijay_rajni
1 Replies
Date::Manip::Migration5to6(3pm) 			User Contributed Perl Documentation			   Date::Manip::Migration5to6(3pm)

NAME
Date::Manip::Migration5to6 - how to upgrade from 5.xx to 6.00 SYNOPSIS
When upgrading from Date::Manip 5.xx to 6.00, a few changes may be necessary to your scripts. The Date::Manip::Changes5to6 document lists in more detail the ways in which Date::Manip changed, but very few of these actually entail changes to your script. It should be noted that once the changes are made to your script, it will no longer run correctly in 5.xx. NECESSARY AND SUGGESTED CHANGES
The following changes are necessary, or strongly suggested: Reading config files with Date_Init If you use Date_Init to read any config files (if you do business mode calculations, you probably do), you should remove all of the following config variables from your call to Date_Init: GlobalCnf=FILE PersonalCnf=FILE PathSep=* IgnoreGlobalCnf=* PersonalCnfPath=* and replace them with: ConfigFile=FILE where FILE is now the full path to a config file. Also, the ConfigFile argument should be the first argument in Date_Init. Date_ConvTZ The Date_ConvTZ function has changed. It should now take 3 arguments: $date = Date_ConvTZ($date,$from,$to); If $from is not given, it defaults to the local time zone. If $to is not given, it defaults to the local time zone. The date is converted from the $from time zone into the $to time zone. Both should be any time zone (or alias) supported by Date::Manip. The old $errlevel argument is no longer handled. ConvTZ and TZ config variables If you use either the ConvTZ or TZ config variables, you should replace them with either SetDate or ForceDate. See the Date::Manip::Config document for information. The TZ variable will continue to work until Dec 2013 at which point it will be removed. Other deprecated config variables The following config variables have been deprecated, but will continue to function (though they will be removed at a future date): IntCharSet (removed Oct 2012) TZ (removed Dec 2013) The following variables have been removed. If you use any of them, you may need to modify your scripts: GlobalCnf PersonalCnf PathSep IgnoreGlobalCnf PersonalCnfPath ConvTZ Internal TodayIsMidnight DeltaSigns UpdateCurrTZ ResetWorkdDay today, yesterday, tomorrow If you parse the strings "today", "yesterday", or "tomorrow" in order to get the time now, or 24 hours in the past/future, this will no longer work. These strings now refer strictly to the date (so "today" is the current day at midnight, "yesterday" is the previous day at midnight, etc.). To get the time now, 24 hours ago, or 24 hours in the future, you would need to parse the strings "now", "-24:00:00", or "+24:00:00" respectively. Do not use Memoize In 5.xx, it was documented that you could use the module Memoize to speed up Date::Manip, especially when sorting dates. This information is no longer accurate. Using Memoize in conjunction with Date::Manip should have little impact on performance, and may lead to incorrect results, especially if you change config variables. Please see the Date::Manip::Changes5to6 (GENERAL CHANGES) document for more information. If you find other instances where it is necessary to modify your script, please email me so that I can add that information to this document. BUGS AND QUESTIONS
Please refer to the Date::Manip::Problems documentation for information on submitting bug reports or questions to the author. SEE ALSO
Date::Manip - main module documentation LICENSE
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Sullivan Beck (sbeck@cpan.org) perl v5.14.2 2012-06-02 Date::Manip::Migration5to6(3pm)
All times are GMT -4. The time now is 07:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy