Batch adding Sym linked files not working Batch adding Sym linked files not working
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Batch adding Sym linked files not working

Started by slowwwdown, March 02, 2006, 05:15:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

slowwwdown

Hello.

I'm trying to sync Coppermine 1.4.3 with files resident on my iPhoto filesystem.  What I'd like to do is symlink the files to save on disk space and have access to them with both apps.   Any ideas or suggestion would be appreciated.

Thanks!


This unlinked file takes to the upload process fine...

$ ls -l ~/Sites/cpg143/albums/sync/iphoto_test.jpg
-rw--w--w-   1 joeclayp  admin  1276719 Mar  1 22:20 ~Sites/cpg143/albums/sync/iphoto_test.jpg

But ones like this do not...

$ ls -l ~/Pictures/Wallpapers/mac_linux.jpg
-rw--w--w-   1 joeclayp  admin  9321 Feb 16 22:28 ~/Pictures/Wallpapers/mac_linux.jpg
$ ls -l ~/Sites/cpg143/albums/sync/mac_linux.jpg
lrwxr-xr-x   1 joeclayp  admin  53 Mar  1 22:10 ~/Sites/cpg143/albums/sync/mac_linux.jpg -> ~/Pictures/Wallpapers//mac_linux.jpg

Version info here...

Darwin Kernel Version 8.5.0
PHP Version 4.3.11
Coppermine 1.4.3


slowwwdown

#1
Hmmm. I had a thought.  Maybe it's that my apache install won't all these files to be read as they're not under my ~/Sites folder.  You'll have to excuse me.  I'm a new to the whole web server thing.  More to come...

Another thought:  should I even be taking this route?  maybe someone has good sugesstion on how to sync these file systems to share the pics between the two apps?  otherwise I'll need to script out something to build the links for CPG when I load new files via iPhoto.

slowwwdown

Now I'm stuck.  Appears it wasn't an issue with the directories apache will let CPG see.  Can anyone comment on how the batch upload process handles symbolic links or help point me in the right direction?

Directory permissions...

$ ls -l
total 8
drwxrwxrwx    3 root      admin   102 Mar  1 23:10 edit
-rwxr-xr-x    1 root      admin  1375 Nov 25 08:11 index.php
drwxrwxrwx   34 joeclayp  admin  1156 Mar  2 10:14 sync
drwxrwxrwx   14 joeclayp  admin   476 Mar  1 21:42 testfolder
drwxrwxrwx    4 root      admin   136 Mar  1 23:10 userpics

This file uploads fine...

$ ls -l testfolder/img161.jpg
-rw-r--r--   1 joeclayp  admin  989276 Feb 23 23:04 testfolder/img161.jpg

This file shows in the "Select directory" pane, but not in the "List of new files" pane after I select the sync folder...

$ ls -l sync/img161.jpg
lrwxr-xr-x   1 joeclayp  admin  21 Mar  2 10:14 sync/img161.jpg -> testfolder/img161.jpg

slowwwdown

For the record I set the config as outlined in the troubleshooting doc and here is the resulting debug stuff...
~~~~~~~~~~~~~~~~~~~~~~

###  directory permissions

drwxrwxrwx   7 root  admin  238 Mar  2 10:14 albums/
drwxrwxrwx   3 root  admin  102 Mar  1 23:10 albums//edit
drwxrwxrwx   34 joeclayp  admin  1156 Mar  2 10:14 albums//sync
drwxrwxrwx   14 joeclayp  admin  476 Mar  1 21:42 albums//testfolder
drwxrwxrwx   4 root  admin  136 Mar  1 23:10 albums//userpics

###  I am using gd

###  debug output "Select directory" pane

USER:
------------------
Array
(
    [ID] => 580421dd6ebed691176ca1050bbc0bed
    [am] => 1
    [lang] => english
    [liv] => Array
        (
            [0] => 151
            [1] => 141
            [2] => 152
            [3] => 2
            [4] => 1
        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => slowwwdown
    [groups] => Array
        (
            [0] => 1
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 0
    [ufc_min] => 0
    [custom_user_upload] => 0
    [num_file_upload] => 1
    [num_URI_upload] => 0
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 0
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg143_filetypes; (0.002s)
    [1] => select * from cpg143_plugins order by priority asc; (0.001s)
    [2] => delete from `mysql`.cpg143_sessions where time<1141327027 and remember=0; (0.001s)
    [3] => delete from `mysql`.cpg143_sessions where time<1140121027; (0.001s)
    [4] => select user_id from `mysql`.cpg143_sessions where session_id=md5("c1198f9797c66f19a7f482c527b7dc33e718984d601d874df3eb251f90fba9f3"); (0.001s)
    [5] => select user_id as id, user_password as password from `mysql`.cpg143_users where user_id=1 (0.001s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `mysql`.cpg143_users AS u INNER JOIN `mysql`.cpg143_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0.001s)
    [7] => SELECT user_group_list FROM `mysql`.cpg143_users AS u WHERE user_id='1' and user_group_list <> ''; (0.001s)
    [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg143_usergroups WHERE group_id in (1) (0.001s)
    [9] => SELECT group_name FROM  cpg143_usergroups WHERE group_id= 1 (0.001s)
    [10] => update `mysql`.cpg143_sessions set time='1141330627' where session_id=md5('c1198f9797c66f19a7f482c527b7dc33e718984d601d874df3eb251f90fba9f3'); (0.001s)
    [11] => SELECT user_favpics FROM cpg143_favpics WHERE user_id = 1 (0s)
    [12] => DELETE FROM cpg143_banned WHERE expiry < '2006-03-03 01:17:07' (0.001s)
    [13] => SELECT * FROM cpg143_banned WHERE (ip_addr='67.191.171.229' OR ip_addr='67.191.171.229' OR user_id=1) AND brute_force=0 (0s)
    [14] => SELECT aid, title FROM cpg143_albums WHERE 1 (0s)
    [15] => SELECT COUNT(*) FROM cpg143_pictures WHERE approved = 'NO' (0s)
)

==========================
GET :
------------------
Array
(
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 4.3.11 - OK
------------------
mySQL version: 4.0.26-standard
------------------
Coppermine version: 1.4.3(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.28 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support: 1
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 3.23.49
MYSQL_MODULE_TYPE builtin
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE no value
MYSQL_LIBS no value
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.1.4
Linked Version 1.2.3
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/local/php/lib/php | .:/usr/local/php/lib/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M
==========================
Page generated in 0.499 seconds - 16 queries in 0.013 seconds - Album set : ; Meta set: ;


###  Debug output on "List of new files" pane...

USER:
------------------
Array
(
    [ID] => 580421dd6ebed691176ca1050bbc0bed
    [am] => 1
    [lang] => english
    [liv] => Array
        (
            [0] => 151
            [1] => 141
            [2] => 152
            [3] => 2
            [4] => 1
        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => slowwwdown
    [groups] => Array
        (
            [0] => 1
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 0
    [ufc_min] => 0
    [custom_user_upload] => 0
    [num_file_upload] => 1
    [num_URI_upload] => 0
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 0
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg143_filetypes; (0.001s)
    [1] => select * from cpg143_plugins order by priority asc; (0.001s)
    [2] => delete from `mysql`.cpg143_sessions where time<1141327216 and remember=0; (0.001s)
    [3] => delete from `mysql`.cpg143_sessions where time<1140121216; (0s)
    [4] => select user_id from `mysql`.cpg143_sessions where session_id=md5("c1198f9797c66f19a7f482c527b7dc33e718984d601d874df3eb251f90fba9f3"); (0s)
    [5] => select user_id as id, user_password as password from `mysql`.cpg143_users where user_id=1 (0s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `mysql`.cpg143_users AS u INNER JOIN `mysql`.cpg143_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
    [7] => SELECT user_group_list FROM `mysql`.cpg143_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
    [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg143_usergroups WHERE group_id in (1) (0.001s)
    [9] => SELECT group_name FROM  cpg143_usergroups WHERE group_id= 1 (0s)
    [10] => update `mysql`.cpg143_sessions set time='1141330816' where session_id=md5('c1198f9797c66f19a7f482c527b7dc33e718984d601d874df3eb251f90fba9f3'); (0s)
    [11] => SELECT user_favpics FROM cpg143_favpics WHERE user_id = 1 (0s)
    [12] => DELETE FROM cpg143_banned WHERE expiry < '2006-03-03 01:20:16' (0.001s)
    [13] => SELECT * FROM cpg143_banned WHERE (ip_addr='67.191.171.229' OR ip_addr='67.191.171.229' OR user_id=1) AND brute_force=0 (0s)
    [14] => SELECT aid, title FROM cpg143_albums WHERE 1 (0s)
    [15] => SELECT COUNT(*) FROM cpg143_pictures WHERE approved = 'NO' (0s)
    [16] => SELECT filepath, filename FROM cpg143_pictures WHERE filepath LIKE 'sync%' (0s)
    [17] => SELECT aid, title FROM cpg143_albums WHERE category = 0 (0s)
    [18] => SELECT DISTINCT a.aid as aid, a.title as title, c.name as cname FROM cpg143_albums as a, cpg143_categories as c WHERE a.category = c.cid AND a.category < '10000' (0s)
    [19] => SELECT aid, CONCAT('(', user_name, ') ', a.title) AS title
FROM cpg143_albums AS a
INNER JOIN `mysql`.cpg143_users AS u
ON category = (10000 + user_id)
ORDER BY title (0.001s)
)

==========================
GET :
------------------
Array
(
    [startdir] => sync
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 4.3.11 - OK
------------------
mySQL version: 4.0.26-standard
------------------
Coppermine version: 1.4.3(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.28 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support: 1
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 3.23.49
MYSQL_MODULE_TYPE builtin
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE no value
MYSQL_LIBS no value
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.1.4
Linked Version 1.2.3
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/local/php/lib/php | .:/usr/local/php/lib/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M
==========================
Page generated in 0.416 seconds - 20 queries in 0.006 seconds - Album set : ; Meta set: ;



Thanks in advance.  I work at company that was founded on open source code and really appreciate what it is everyone does here.  My problems here are with my personal machine and not an urgent matter.  Please take your time and let me know what you think.


Nibbler

I'm not clear on what you are linking to where and how. I can make a symlink from the albums dir to another dir on my machine and all works as expected. Coppermine isn't aware of the symlink since it is handled on a much lower level.

slowwwdown

Ok.  I'll dig deeper on my end then and let y'all know what I come up with.  Many thanks.

slowwwdown

OK.  I've got it now.  I had to adjust the permissions on the directory structure I was seeing through the link.  ::)

~~~~~~~~~~~~~~~~~~~~~

###  So I built this link....

ln -s ~/Pictures/ albums/sync2

###  Then did this so I could pull up all the jpegs form the linked dirs...

cd ~/Pictures
find ./ -type d -exec chmod 777 {} \;
find ./ -name *.jpg -exec chmod 666 {} \;

### ...and now there is joy throughout the land.