Sponsored Content
Full Discussion: Backup user folder
Operating Systems OS X (Apple) Backup user folder Post 303010092 by peli on Tuesday 26th of December 2017 01:35:13 PM
Old 12-26-2017
Backup user folder

Hi, I have a postinstall script included in an Installer which has worked properly in the future. Now, for some reason, a part is not working. The function of the part in the script is to backup the User's folder to the desktop in order for the installed app to copy new files from the Library/Application Support to the User/Library/Application Support directory. The part of the script looks like this:

Code:
################################################################################
#
# Move user's files so app will update those files
#
################################################################################
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = $year + 1900;
$mon = $mon + 1;
$timeStampString = sprintf("%04u.%02u.%02u_%02u.%02u.%02u", $year, $mon, $mday, $hour, $min, $sec);
$userFileBackupDir = $ENV{"HOME"}."/Desktop/Finale User Backup/".$PKG_RECORD_VERSION."_Backup_".$timeStampString;
foreach $relativeFilePath (@MOVE_USER_FILES_FOR_UPDATES) {
    $existingPath = $ENV{"HOME"}."/".$relativeFilePath;
    print "checking: $existingPath\n";
    if ( -e $existingPath )  {
        $backupPath = $userFileBackupDir."/".$relativeFilePath;
        makeDirAtPath_(parentDirOfPath_($backupPath));
        print "  moving: $backupPath\n";
        rename($existingPath, $backupPath);
    }
}

I can contribute the entire script if needed

Thank's
peli
 

10 More Discussions You Might Find Interesting

1. AIX

How to disable cd to other folder for a user

How to disable user for cd to some another folders other than his folders. AIX 5L 5.2 Thanks Dilip. (1 Reply)
Discussion started by: Dilippatel
1 Replies

2. UNIX for Dummies Questions & Answers

Backup user from one server and restore to another

Hi. I have a situation here where I need to backup a users' home directory and restore onto another server. The issue here is that both servers have different operating systems and I am looking for advices on how to proceed. The source server operating system is Tru64 v5.1, and here's the output... (1 Reply)
Discussion started by: fidodido
1 Replies

3. UNIX for Dummies Questions & Answers

User should be restricted moving a folder

Hi All , Some of the users should be restricted using the MV commands on some of the standard folders. We had an issue the other day like from the standard folder structure which was set up one of the user has moved a folder to a different location and the jobs failed as the folder was not... (6 Replies)
Discussion started by: perlamohan
6 Replies

4. AIX

User script folder standard location ?

I am starting to accumulate a few scripts that I working on to replace operational scripts and to have a few for my personal usage. I am not an admin, just an operator. They are currently located inside the /tmp folder. I know they should not be there but since we have no system admin (someone... (4 Replies)
Discussion started by: Browser_ice
4 Replies

5. UNIX for Dummies Questions & Answers

How to restrict user to one folder alone when they log in

Can some one help me with this issue . I require to restrict a particular user to a particular folder alone when they log in. I dont want this particular user to come out of this folder. Kindly help (7 Replies)
Discussion started by: kirbhas72
7 Replies

6. Solaris

Unable to create folder as a user

Hi All, I am trying to create a folder in /export/home/user1 directory as a user1 but I am getting the error message as -bash-3.00$ mkdir abc mkdir: Failed to make directory "abc"; Permission denied Also I tried creating the folder but it fails too -bash-3.00$ touch abc touch: cannot... (2 Replies)
Discussion started by: Manjunath K V
2 Replies

7. 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

8. HP-UX

Temp folder Getting full while taking backup.

Hi Experts, When i taking backup of my servers in Tape Library simultaneously the Temp folder is getting full...... these file like OB2DBG*.txt (2 Replies)
Discussion started by: purushottamaher
2 Replies

9. Shell Programming and Scripting

Create a folder under different user directory

Hello All, I have to write a shell script and use it in informatica. The script has to perform below actions: The script gets executed from edw user. Through the script, a DT folder has to be created under edw_sca user. Is this scenario possible through a SHELL script or not. ... (2 Replies)
Discussion started by: bghosh
2 Replies

10. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: bakula10
2 Replies
POSIX::strptime(3pm)					User Contributed Perl Documentation				      POSIX::strptime(3pm)

NAME
POSIX::strptime - Perl extension to the POSIX date parsing strptime(3) function SYNOPSIS
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = POSIX::strptime("string", "Format"); DESCRIPTION
Perl interface to strptime(3) FUNCTIONS
strptime ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = POSIX::strptime(string, format); The result for any value not extracted is not defined. Some platforms may reliably return "undef", but this is dependent on the strptime(3) function in the underlying C library. For example, only the following fields may be relied upon: my ($min, $hour) = ( POSIX::strptime( "01:23", '%H:%M' ) )[1,2]; my ($mday, $mon, $year) = ( POSIX::strptime( "2010/07/16", '%Y/%m/%d' ) )[3,4,5]; Furthermore, not all platforms will set the $wday and $yday elements. If these values are required, use "mktime" and "gmtime": use POSIX qw( mktime ); use POSIX::strptime qw( strptime ); my ($mday, $mon, $year) = ( POSIX::strptime( "2010/07/16", '%Y/%m/%d' ) )[3,4,5]; my $wday = ( gmtime mktime 0, 0, 0, $mday, $mon, $year )[6]; SEE ALSO
strptime(3) AUTHOR
Philippe M. Chiasson <gozer@cpan.org> Kim Scheibel <kim@scheibel.co.uk> REPOSITORY
http://svn.ectoplasm.org/projects/perl/POSIX-strptime/trunk/ COPYRIGHT
Copyright 2005 by Philippe M. Chiasson <gozer@cpan.org>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2010-07-16 POSIX::strptime(3pm)
All times are GMT -4. The time now is 02:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy